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

correct group verifier to check a group exists on the system #182

Closed raldred closed 10 years ago

raldred commented 10 years ago

You cannot verify a group exists with id -g alone. It's commonly incorrectly documented that you can run id -g groupname infact it is for displaying user and group information of the calling process, ie the current user, or if passed a specific user. usage: id -AGnMPgrpu [user]

This patch correctly implements checking whether a group exists on a unix system.

Fixes #179

Note: I decided against using getent because it is no longer available on OSX since Apple started using DirectoryService instead of NetInfo