This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Why mkgroup does not list group members?
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 13 May 2013 20:29:52 +0200
- Subject: Re: Why mkgroup does not list group members?
- References: <5F8AAC04F9616747BC4CC0E803D5907D0AF7961F at MLBXv04 dot nih dot gov> <20130513175045 dot GJ8890 at calimero dot vinschen dot de> <5F8AAC04F9616747BC4CC0E803D5907D0AF7964F at MLBXv04 dot nih dot gov> <20130513180639 dot GM8890 at calimero dot vinschen dot de> <5F8AAC04F9616747BC4CC0E803D5907D0AF7968A at MLBXv04 dot nih dot gov> <20130513182319 dot GN8890 at calimero dot vinschen dot de>
- Reply-to: cygwin at cygwin dot com
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