GNU bug report logs - #52656
(id) utility bug found

Previous Next

Package: coreutils;

Reported by: Morteza Ghorbani <morteza.ghorbani <at> live.com>

Date: Sun, 19 Dec 2021 14:28:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52656 in the body.
You can then email your comments to 52656 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#52656; Package coreutils. (Sun, 19 Dec 2021 14:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Morteza Ghorbani <morteza.ghorbani <at> live.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 19 Dec 2021 14:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morteza Ghorbani <morteza.ghorbani <at> live.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: (id) utility bug found
Date: Sun, 19 Dec 2021 11:01:37 +0000
[Message part 1 (text/plain, inline)]
Hello
I am Morteza Ghorbani
While Working with id utility, I found strange behavior.
Suppose that my username is ‘user1’ , so if I remove user1 from a particular group (e.g. netdev)  by the following instruction :
gpasswd –delete user1 netdev

then if I enter the ‘id’ command, I will be noted that nothing has been changed and still see the group which I removed the use1 from.
On the other hand, if I enter the command ‘ id user1 ‘, by this way I can see the changes !

In a nutshell,  ‘id’ --> does not show the changes while ‘id user1’ shows the changes and its behavior is correct.
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#52656; Package coreutils. (Sun, 19 Dec 2021 14:57:01 GMT) Full text and rfc822 format available.

Message #8 received at 52656 <at> debbugs.gnu.org (full text, mbox):

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: Morteza Ghorbani <morteza.ghorbani <at> live.com>, 52656 <at> debbugs.gnu.org
Subject: Re: bug#52656: (id) utility bug found
Date: Sun, 19 Dec 2021 14:56:31 +0000

On 19/12/2021 11:01, Morteza Ghorbani wrote:
> Hello
> I am Morteza Ghorbani
> While Working with id utility, I found strange behavior.
> Suppose that my username is ‘user1’ , so if I remove user1 from a particular group (e.g. netdev)  by the following instruction :
> gpasswd –delete user1 netdev
> 
> then if I enter the ‘id’ command, I will be noted that nothing has been changed and still see the group which I removed the use1 from.

You have to log out/in to do the change. Then it will show the change in 
'id'.

> On the other hand, if I enter the command ‘ id user1 ‘, by this way I can see the changes !

That looks up the latest definition of 'user1'

> 
> In a nutshell,  ‘id’ --> does not show the changes while ‘id user1’ shows the changes and its behavior is correct.
> 


-- 

Chris Elvidge




Information forwarded to bug-coreutils <at> gnu.org:
bug#52656; Package coreutils. (Sun, 19 Dec 2021 14:59:02 GMT) Full text and rfc822 format available.

Message #11 received at 52656 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Golden <gdg <at> zplane.com>
To: Morteza Ghorbani <morteza.ghorbani <at> live.com>
Cc: 52656 <at> debbugs.gnu.org
Subject: Re: bug#52656: (id) utility bug found
Date: Sun, 19 Dec 2021 07:58:39 -0700
Morteza Ghorbani <morteza.ghorbani <at> live.com> [2021-12-19 11:01:37 +0000]:
> Hello
> I am Morteza Ghorbani
> While Working with id utility, I found strange behavior.
> Suppose that my username is ‘user1’ , so if I remove user1 from a 
> particular group (e.g. netdev) by the following instruction : 
> gpasswd –delete user1 netdev
> 
> then if I enter the ‘id’ command, I will be noted that nothing has 
> been changed and still see the group which I removed the use1 from. 
> On the other hand, if I enter the command ‘ id user1 ‘, by this way 
> I can see the changes ! 
> 
> In a nutshell, ‘id’ --> does not show the changes while ‘id 
> user1’ shows the changes and its behavior is correct. 
>

The above behavior is expected, and documented in coreutils.info going
back to at least 8.30 (September 2018):

   "Primary and supplementary groups for a process are normally inherited
    from its parent and are usually unchanged since login.  This means that
    if you change the group database after logging in, ‘id’ will not reflect
    your changes within your existing login session.  Running ‘id’ with a
    user argument causes the user and group database to be consulted afresh,
    and so will give a different result."

However, there does seem to be a disconnect between the 'id' man page and
coreutils.info, even in coreutils 9.0, which imo could benefit from some
minor language improvement: The first sentence of the man page says

   "Print user and group information for each specified USER, or (when USER
    omitted) for the current user."

but coreutils.info says

    "‘id’ prints information about the given user, or the process running
    it if no user is specified."

The coreutils.info is probably 'more correct', because it seems to explain
why the no-user-specified behavior is the way it is.  Possibly the man page
could be updated to say the same.

Glenn




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 19 Dec 2021 17:27:01 GMT) Full text and rfc822 format available.

Notification sent to Morteza Ghorbani <morteza.ghorbani <at> live.com>:
bug acknowledged by developer. (Sun, 19 Dec 2021 17:27:02 GMT) Full text and rfc822 format available.

Message #16 received at 52656-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Glenn Golden <gdg <at> zplane.com>
Cc: 52656-done <at> debbugs.gnu.org, Morteza Ghorbani <morteza.ghorbani <at> live.com>
Subject: Re: bug#52656: (id) utility bug found
Date: Sun, 19 Dec 2021 09:26:03 -0800
[Message part 1 (text/plain, inline)]
On 12/19/21 06:58, Glenn Golden wrote:
> Possibly the man page
> could be updated to say the same.

Thanks for the suggestion. I installed the attached documentation patch 
and am closing the bug report.
[0001-id-improve-doc-for-when-USER-is-omitted.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 17 Jan 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.