This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "id -Gn" w/ username doesn't return all associated groups. Issue with getgrent()?


On Jan 21 16:50, Mark A. Ziesemer wrote:
> Cygwin doesn't appear to properly support returning multiple groups for a
> specific user, other than the current user (and only when not specifying the
> current user's username.)
> 
> 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.

> I've setup a public wiki with all the details where I hope we can
> collaborate to finally solve this issue:
> http://cygwin-getugroups.pbwiki.com/  Included there are the requested
> cygcheck and related files.

The place to discuss Cygwin stuff is this mailing list.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]