Why mkgroup does not list group members?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon May 13 18:30:00 GMT 2013


On May 13 20:23, Corinna Vinschen wrote:
> On May 13 18:17, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > I may have put it a bit incorrectly,
> > 
> > > In that case, your expectations of the getgrXXX functions are wrong.
> > 
> > but I don't think so.  I am looking if a user belongs to a group,
> > either as their primary or secondary one.  So when using getgrXXX()
> > I check to see if a user (whose primary, passwd-supplied, gid does not
> > match the gid of the group) is listed as a member.  In CYGWIN that does
> > not work because the information is missing from the group file.
> 
> Then use Windows functions to fetch the information.  This is still
> better than to add all users to all groups they belong to.  The
> passwd/group information is kept in memory.  I'm shuddering to think of
> the memory requirements if all gr_mem fields are filled in a bigger
> company.

Instead of using Windows functions you can also use the POSIX function
getgrouplist, which is implemented in Cygwin, and which returns a group
list containing all groups of a user, provided the group is listed in
/etc/groups.


Corinna

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

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



More information about the Cygwin mailing list