GNU bug report logs - #18946
a problem or a 'bug' about the command groups

Previous Next

Package: coreutils;

Reported by: yangzhao <plyang123 <at> 126.com>

Date: Tue, 4 Nov 2014 16:40:03 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

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 18946 in the body.
You can then email your comments to 18946 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#18946; Package coreutils. (Tue, 04 Nov 2014 16:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to yangzhao <plyang123 <at> 126.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 04 Nov 2014 16:40:03 GMT) Full text and rfc822 format available.

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

From: yangzhao <plyang123 <at> 126.com>
To: bug-coreutils <at> gnu.org
Subject: a problem or a 'bug' about the command groups
Date: Tue, 4 Nov 2014 19:43:49 +0800 (CST)
[Message part 1 (text/plain, inline)]
Excuse me,
             I use command 'group -d ' to delete   user  ak from a group  testgroup. Then ,something confusing comes to me.I use command groups as ak ,and get ak ,testgroup  ,them two. But when I use groups ak , I get ak only. And I take a look at /etc/group for testgroup ,there is nothing with ak,so I want to ask ,which file does command groups look up ?
                                                                                                                                                                                                                   Thanks,   
                                                                                                                                                                                                                Yours,sincerely
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 04 Nov 2014 17:06:01 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Tue, 04 Nov 2014 17:06:02 GMT) Full text and rfc822 format available.

Notification sent to yangzhao <plyang123 <at> 126.com>:
bug acknowledged by developer. (Tue, 04 Nov 2014 17:06:02 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: yangzhao <plyang123 <at> 126.com>, 18946-done <at> debbugs.gnu.org
Subject: Re: bug#18946: a problem or a 'bug' about the command groups
Date: Tue, 04 Nov 2014 18:04:55 +0100
[Message part 1 (text/plain, inline)]
tag 18946 notabug
thanks

On 11/04/2014 12:43 PM, yangzhao wrote:
> Excuse me,
>              I use command 'group -d ' to delete   user  ak from a group  testgroup. Then ,something confusing comes to me.I use command groups as ak ,and get ak ,testgroup  ,them two. But when I use groups ak , I get ak only. And I take a look at /etc/group for testgroup ,there is nothing with ak,so I want to ask ,which file does command groups look up ?

'groups' tells you the groups associated with the current process, which
is not necessarily the same as you would get by starting a new session
for that user.  'groups ak' tells you the groups that are associated
with the user name 'ak' as determined by an /etc/group lookup (or
similar action), which is what you would get when starting a new session.

Most likely, what happened is that in your testing, you have NOT YET
logged out and back in to start a new session.  Thus, the current
process is STILL associated with testgroup, even though new sessions
(and though 'group ak') will no longer be associated with testgroup.

Therefore, I'm marking this as not a bug, although you should feel free
to provide more details if I have missed something in guessing from your
brief description.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#18946; Package coreutils. (Tue, 04 Nov 2014 17:11:01 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: 18946 <at> debbugs.gnu.org, plyang123 <at> 126.com
Subject: Re: bug#18946: a problem or a 'bug' about the command groups
Date: Tue, 04 Nov 2014 18:10:02 +0100
[Message part 1 (text/plain, inline)]
On 11/04/2014 06:04 PM, Eric Blake wrote:
> tag 18946 notabug
> thanks
> 
> On 11/04/2014 12:43 PM, yangzhao wrote:
>> Excuse me,
>>              I use command 'group -d ' to delete   user  ak from a group  testgroup. Then ,something confusing comes to me.I use command groups as ak ,and get ak ,testgroup  ,them two. But when I use groups ak , I get ak only. And I take a look at /etc/group for testgroup ,there is nothing with ak,so I want to ask ,which file does command groups look up ?
> 
> 'groups' tells you the groups associated with the current process, which
> is not necessarily the same as you would get by starting a new session
> for that user.  'groups ak' tells you the groups that are associated
> with the user name 'ak' as determined by an /etc/group lookup (or
> similar action), which is what you would get when starting a new session.
> 
> Most likely, what happened is that in your testing, you have NOT YET
> logged out and back in to start a new session.  Thus, the current
> process is STILL associated with testgroup, even though new sessions
> (and though 'group ak') will no longer be associated with testgroup.

If you want to see what operations are being done in the two scenarios,
try running 'strace groups' and 'strace groups ak'; you'll notice
different syscalls between the two (those for determining the group
membership of the current process, vs. those used for determining the
groups to use when starting a new session).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 03 Dec 2014 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 284 days ago.

Previous Next


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