Closed raldred closed 10 years ago
id -g often works in my testing on the console just now… even if the group does not belong to the user in question. Will need a few other people to confirm this before we make a change (though I think I agree). id -g is definitely not "checking if user is in a group" for me… it appears to check if a group exists and return it's ID if it does… but sometimes it doesn't return the ID when getent does. But it works many times even if the current user is not a member of any of the groups I'm checking.
Marking this confirmed since id -g does not always work properly. raldred: Can you submit a patch for this with tests?
Sure thing, thanks for your reply.I'll push a patch in the morning. On 2 Dec 2013 21:53, "Josh Goebel" notifications@github.com wrote:
Marking this confirmed since id -g does not always work properly. raldred: Can you submit a patch for this with tests?
— Reply to this email directly or view it on GitHubhttps://github.com/sprinkle-tool/sprinkle/issues/179#issuecomment-29661641 .
If you can do this tomorrow I'll get it in 0.7.7 and do a release with this and the other fix.es
It uses
id -g #{group}
which checks if the user is in a group rather than if the group exists on the system. Is this the intended behaviour?If not then it need changing to
getent group #{group}