delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/22/20:15:36

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "Mark A. Ziesemer" <mark_z AT charter DOT net>
Subject: Re: "id -Gn" w/ username doesn't return all associated groups. Issue with getgrent()?
Date: Tue, 23 Jan 2007 01:11:31 +0000 (UTC)
Lines: 40
Message-ID: <loom.20070123T015759-76@post.gmane.org>
References: <001a01c73dae$7dec4af0$6152a8c0 AT ziesemermark> <20070122093419 DOT GR27843 AT calimero DOT vinschen DOT de> <45B4B622 DOT 9040406 AT byu DOT net> <20070122132934 DOT GU27843 AT calimero DOT vinschen DOT de> <loom DOT 20070122T160919-481 AT post DOT gmane DOT org> <20070122154045 DOT GX27843 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > Since Cygwin already lets the underlying OS take care of much of the
> > security (handling passwords, etc.), can't Cygwin just ask Windows for the
> > user's groups when needed, to?
> 
> How?  Consider that getgrent just enumerates /etc/group.  It doesn't
> know for what purpose the calling application does it.  I don't think it
> makes a lot of sense to call a OS function for each getgrent call to
> fill out the gr_mem field on the fly.
> 
> Having said that, I don't intend to change this behaviour myself.
> However, I'm certainly not averse to patches to Cygwin which add this
> behaviour, as long as it's not getting too slow by this.
> 
> Corinna
> 
> P.S.: How did the subject disappear?!?

No clue about the subject - I'm using Gmane to reply, since I'm usually
without reliable SMTP access.

If group membership IS currently required to be listed in /etc/group for
these functions (groups, id, getugroups(), getgrent(), etc...), shouldn't
mkgroup -ul, with the "-u", be run by default at Cygwin first-run?  Also,
including this better in the documentation would be a plus.

Also, "mkgroup -u" has a bug, as far as I'm concerned.  It always includes the
Windows' username, even if renamed in /etc/passwd for Cygwin-purposes.  For
example, take a Windows username of "John Smith".  I renamed the first field
in /etc/passwd to "jsmith" to avoid the space.  "jsmith" should (and needs) to
be included in the gr_mem field, not "John Smith", otherwise all of the above
functions fail to see that this user is a member of any groups...

I do see one issue with implementing the OS-group-calls into Cygwin - 
Win95/98 don't have any concept of user groups.  This would have to be
accounted for...  Maybe I'll convert the
http://http://cygwin-getugroups.pbwiki.com/ site to address the
possibility of adding this functionality...

Thanks for the replies!


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019