This is the mail archive of the
mailing list for the Cygwin project.
Re: "id -Gn" w/ username doesn't return all associated groups. Issue with getgrent()?
-----BEGIN PGP SIGNED MESSAGE-----
According to Corinna Vinschen on 1/22/2007 2:34 AM:
>> When "id" is called without a username, it calls the getgroups(...) function
>> which appears to work as expected. However, when a specific username is
>> passed, even the username of the current user, getugroups(...) is called,
>> and does _not_ appear to work as expected.
> That's by design. getgroups() has access to the user token of the
> current process and returns every group which is in this token.
> getgrent() is a function which enumerates /etc/groups.
So my translation of this would be that the bug is not in id, but in the
fact that your /etc/groups is out-of-date. Use mkgroups to remedy the
Don't work too hard, make some time for fun as well!
Eric Blake email@example.com
volunteer cygwin coreutils maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html