Patch to getgroups()

Corinna Vinschen
Mon Apr 16 07:22:00 GMT 2001


I have changed the getgroups() function so that the behaviour
changes when `ntsec' is on.

In that case getgroups doesn't return the list of groups for
which the user is added to /etc/groups (and the primary group
of course) but instead getgroups() opens the process token
and reads the group list of the process from there. Then the
group is searched in /etc/groups by SID. If it's found, the
Cygwin gid is added to the grouplist.

That means, getgroups() now in fact returns the list of
supplementary groups of the process as it's intended.

All groups which are not found in /etc/groups are ignored.
This are typically groups like:

	S-1-5-5-0-xxxxx		The unique login SID
	S-1-2-0			LOCAL
	S-1-5-6			SERVICE
	S-1-5-11		Authenticated Users

Would you please give that change a try and look if it's ok or
if there's a reason to drop it again, perhaps.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

More information about the Cygwin-developers mailing list