Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Apr 2005 18:41:40 +0100
From:      David Taylor <davidt@yadt.co.uk>
To:        Robert Drehmel <robert@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/id id.c
Message-ID:  <20050428174140.GB21634@outcold.yadt.co.uk>
In-Reply-To: <200504281555.j3SFtsYB052286@repoman.freebsd.org>
References:  <200504281555.j3SFtsYB052286@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050428174140.GB21634>