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@byu.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@cygwin.com, mark_z@charter.net
Subject: Re: "id -Gn" w/ username doesn't return all associated groups.  Issue  with getgrent()?
References: <001a01c73dae$7dec4af0$6152a8c0@ziesemermark> <20070122093419.GR27843@calimero.vinschen.de>
In-Reply-To: <20070122093419.GR27843@calimero.vinschen.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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@byu.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/

