From owner-cvs-all@FreeBSD.ORG Sat May 7 03:35:47 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FB9716A4D6; Sat, 7 May 2005 03:35:47 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id D29CA43D1D; Sat, 7 May 2005 03:35:41 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b128.otenet.gr [212.205.244.136]) j473YDuM027191; Sat, 7 May 2005 06:34:14 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j473ZZCA041188; Sat, 7 May 2005 06:35:35 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j473ZZmp041187; Sat, 7 May 2005 06:35:35 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 7 May 2005 06:35:34 +0300 From: Giorgos Keramidas To: John Baldwin , Robert Drehmel Message-ID: <20050507033534.GB25267@gothmog.gr> References: <200504281555.j3SFtsYB052286@repoman.freebsd.org> <200504281308.51058.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200504291011.j3TABIaM036367@repoman.freebsd.org> cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.bin/id id.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2005 03:35:47 -0000 On 2005-04-28 13:08, John Baldwin wrote: >On Thursday 28 April 2005 11:55 am, Robert Drehmel wrote: >> Modified files: >> usr.bin/id id.c >> Log: >> - Merge two functions for printing `id' output. >> Showing the ids of both an user given by an argument to `id', >> and the current user, is now handled in a single function. >> Displaying the current user's ids was inaccurate because >> getgroups(2) had been used. getgroups(2) returns the current >> kernel state of a user's groups, which may not always be >> correct if /etc/group was recently changed. > > I thought that was a feature rather than a bug since it shows you your real > actual credentials. It is a feature, imho. Displaying the current credentials may show different output in two sessions that span a period that includes changes to /etc/group, but this is the Right Thing(TM). By showing something different than the current credentials, a user may be tricked into believing he actually *has* permission to a file when that is not true for the current session :-( On 2005-04-29 10:11, Robert Drehmel wrote: > Add flag to choose whether to use getgrouplist(3) or getgroups(2) > to the id_print() function. > > Use getgrouplist(3) for the case when an user was specified, > and getgroups(2) when no user was given. > That reverts to the expected behaviour and makes it easy to > implement an option later to force using getgrouplist(3). > > Revision Changes Path > 1.26 +11 -6 src/usr.bin/id/id.c Amazing! Thanks for this :)))