From owner-cvs-all@FreeBSD.ORG Thu Apr 28 17:41:14 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 CBDDE16A4CE; Thu, 28 Apr 2005 17:41:14 +0000 (GMT) Received: from outcold.yadt.co.uk (outcold.yadt.co.uk [81.187.204.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A26D43D48; Thu, 28 Apr 2005 17:41:14 +0000 (GMT) (envelope-from davidt@yadt.co.uk) Received: from localhost (localhost [127.0.0.1]) by outcold.yadt.co.uk (Postfix) with ESMTP id 95E511DD59C; Thu, 28 Apr 2005 18:41:46 +0100 (BST) Received: from outcold.yadt.co.uk ([127.0.0.1]) by localhost (outcold.yadt.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01823-16; Thu, 28 Apr 2005 18:41:40 +0100 (BST) Received: by outcold.yadt.co.uk (Postfix, from userid 1001) id 402ED1DD598; Thu, 28 Apr 2005 18:41:40 +0100 (BST) Date: Thu, 28 Apr 2005 18:41:40 +0100 From: David Taylor To: Robert Drehmel Message-ID: <20050428174140.GB21634@outcold.yadt.co.uk> Mail-Followup-To: Robert Drehmel , cvs-all@FreeBSD.org References: <200504281555.j3SFtsYB052286@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <200504281555.j3SFtsYB052286@repoman.freebsd.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: amavisd-new 2.2.1 (20041222) at yadt.co.uk 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: Thu, 28 Apr 2005 17:41:14 -0000 On Thu, 28 Apr 2005, Robert Drehmel wrote: > robert 2005-04-28 15:55:54 UTC > > FreeBSD src repository > > 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. That depends on how you define 'correct'... Previously `id' would give you the list of groups that your shell was actually in. `id $USER' would give you the list of groups that your account was in according to /etc/group. So running `newgrp $foo' as root, then typing `id' now gives the wrong values, IMO. Plus it seems to me that the previous behaviour was correct -- if /etc/group was recently changed (i.e. since the user logged in) the shell's privileges wouldn't be updated, so id was reporting what it was asked to. -- David Taylor