{"action":"created","issue":{"url":"https://api.github.com/repos/essentialkaos/ek/issues/148","repository_url":"https://api.github.com/repos/essentialkaos/ek","labels_url":"https://api.github.com/repos/essentialkaos/ek/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/essentialkaos/ek/issues/148/comments","events_url":"https://api.github.com/repos/essentialkaos/ek/issues/148/events","html_url":"https://github.com/essentialkaos/ek/issues/148","id":256683467,"number":148,"title":"Broken group info parsing in system package","user":{"login":"gongled","id":2451611,"avatar_url":"https://avatars2.githubusercontent.com/u/2451611?v=4","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"labels":[{"id":286139357,"url":"https://api.github.com/repos/essentialkaos/ek/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"andyone","id":182020,"avatar_url":"https://avatars3.githubusercontent.com/u/182020?v=4","gravatar_id":"","url":"https://api.github.com/users/andyone","html_url":"https://github.com/andyone","followers_url":"https://api.github.com/users/andyone/followers","following_url":"https://api.github.com/users/andyone/following{/other_user}","gists_url":"https://api.github.com/users/andyone/gists{/gist_id}","starred_url":"https://api.github.com/users/andyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyone/subscriptions","organizations_url":"https://api.github.com/users/andyone/orgs","repos_url":"https://api.github.com/users/andyone/repos","events_url":"https://api.github.com/users/andyone/events{/privacy}","received_events_url":"https://api.github.com/users/andyone/received_events","type":"User","site_admin":false},"assignees":[{"login":"andyone","id":182020,"avatar_url":"https://avatars3.githubusercontent.com/u/182020?v=4","gravatar_id":"","url":"https://api.github.com/users/andyone","html_url":"https://github.com/andyone","followers_url":"https://api.github.com/users/andyone/followers","following_url":"https://api.github.com/users/andyone/following{/other_user}","gists_url":"https://api.github.com/users/andyone/gists{/gist_id}","starred_url":"https://api.github.com/users/andyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyone/subscriptions","organizations_url":"https://api.github.com/users/andyone/orgs","repos_url":"https://api.github.com/users/andyone/repos","events_url":"https://api.github.com/users/andyone/events{/privacy}","received_events_url":"https://api.github.com/users/andyone/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-09-11T12:24:13Z","updated_at":"2017-09-12T01:23:16Z","closed_at":null,"author_association":"NONE","body":"### Bug report\r\n\r\n**System info:** CentOS 6 x84_64\r\n\r\n* **Version used:** ek.v9\r\n* **OS (e.g. from `/etc/os-release`):** CentOS release 6.8\r\n* **Kernel (e.g. `uname -a`):** Linux 2.6.32-642.15.1.el6.x86_64 #1 SMP Fri Feb 24 14:31:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n* **Go version (e.g. `go version`):** 1.8.1\r\n\r\n**Steps to reproduce:**\r\n\r\n1. Build binary from the following source code:\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n        \"pkg.re/essentialkaos/ek.v9/system\"\r\n)\r\n\r\nfunc main() {\r\n\tuser, err := system.CurrentUser()\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err.Error())\r\n\t} else {\r\n        fmt.Println(user.UID, user.GID, user.Name)\r\n\t\tfor _, group := range(user.Groups) {\r\n                        fmt.Println(group.Name)\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\n2. Run binary on target system with LDAP installed and configured. Here is the output of `id` command:\r\n```\r\nuid=10591(ggoncharov) gid=10591(ggoncharov) groups=10591(ggoncharov),10507(admins),10510\r\n```\r\n\r\n**Expected behavior:**\r\n\r\n```\r\n10591 10591 ggoncharov\r\nggoncharov\r\nadmins\r\n```\r\n\r\n**Actual behavior:**\r\n\r\n```\r\npanic: runtime error: index out of range\r\n\r\ngoroutine 1 [running]:\r\npkg.re/essentialkaos/ek.v9/system.parseGroupInfo(0xc4200b0058, 0x5, 0x1)\r\n\t/golang/src/pkg.re/essentialkaos/ek.v9/system/user.go:347 +0x14f\r\npkg.re/essentialkaos/ek.v9/system.appendGroupInfo(0xc42008e120)\r\n\t/golang/src/pkg.re/essentialkaos/ek.v9/system/user.go:261 +0x1a9\r\npkg.re/essentialkaos/ek.v9/system.LookupUser(0xc42000e540, 0xb, 0x0, 0x1, 0x549840)\r\n\t/golang/src/pkg.re/essentialkaos/ek.v9/system/user.go:155 +0x7d\r\npkg.re/essentialkaos/ek.v9/system.CurrentUser(0x0, 0x0, 0x0, 0xc420037f10, 0x0, 0xc420037f78)\r\n\t/golang/src/pkg.re/essentialkaos/ek.v9/system/user.go:128 +0x57\r\nmain.main()\r\n\t/golang/src/github.com/test/main.go:9 +0x4e\r\n```\r\n\r\n@andyone I suppose we should ignore groups without names. Sometimes group identifier may exist without text description what name of the group it is.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/essentialkaos/ek/issues/comments/328703721","html_url":"https://github.com/essentialkaos/ek/issues/148#issuecomment-328703721","issue_url":"https://api.github.com/repos/essentialkaos/ek/issues/148","id":328703721,"user":{"login":"andyone","id":182020,"avatar_url":"https://avatars3.githubusercontent.com/u/182020?v=4","gravatar_id":"","url":"https://api.github.com/users/andyone","html_url":"https://github.com/andyone","followers_url":"https://api.github.com/users/andyone/followers","following_url":"https://api.github.com/users/andyone/following{/other_user}","gists_url":"https://api.github.com/users/andyone/gists{/gist_id}","starred_url":"https://api.github.com/users/andyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyone/subscriptions","organizations_url":"https://api.github.com/users/andyone/orgs","repos_url":"https://api.github.com/users/andyone/repos","events_url":"https://api.github.com/users/andyone/events{/privacy}","received_events_url":"https://api.github.com/users/andyone/received_events","type":"User","site_admin":false},"created_at":"2017-09-12T01:23:16Z","updated_at":"2017-09-12T01:23:16Z","author_association":"OWNER","body":"Fixed in #147"}}
{"actor":{"display_login":"andyone"}}