sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

Group verifier does not verifiy a group exists. #179

Closed raldred closed 10 years ago

raldred commented 10 years ago

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}

joshgoebel commented 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.

joshgoebel commented 10 years ago

Marking this confirmed since id -g does not always work properly. raldred: Can you submit a patch for this with tests?

raldred commented 10 years ago

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 .

joshgoebel commented 10 years ago

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