delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/22/08:03:51

X-Spam-Check-By: sourceware.org
Message-ID: <45B4B622.9040406@byu.net>
Date: Mon, 22 Jan 2007 06:03:30 -0700
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, mark_z AT charter DOT net
Subject: Re: "id -Gn" w/ username doesn't return all associated groups. Issue with getgrent()?
References: <001a01c73dae$7dec4af0$6152a8c0 AT ziesemermark> <20070122093419 DOT GR27843 AT calimero DOT vinschen DOT de>
In-Reply-To: <20070122093419.GR27843@calimero.vinschen.de>
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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 1/22/2007 2:34 AM:
>> 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.

So my translation of this would be that the bug is not in id, but in the
fact that your /etc/groups is out-of-date.  Use mkgroups to remedy the
situation.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
volunteer cygwin coreutils maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFtLYi84KuGfSFAYARAniSAJ98xc4e+t/eN6oyjTUJh3db5/DnLACgx3bC
WhRr6QVDuMuFUfJvp/zCRr8=
=OOLE
-----END PGP SIGNATURE-----

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