Bug 816708
Summary: | id and groups commands sometimes lie | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Marc Mengel <mengel> | |
Component: | coreutils | Assignee: | Ondrej Vasik <ovasik> | |
Status: | CLOSED ERRATA | QA Contact: | Tomas Dolezal <todoleza> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.4 | CC: | azelinka, ovasik, prc, rvdwees, todoleza | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | coreutils-8.4-22.el6 | Doc Type: | Bug Fix | |
Doc Text: |
Cause:
Commands id and groups, when invoked with no user name argument, print the default group ID listed in the password database.
Consequence:
Sometimes, that ID would be neither real nor effective - especially when it changes.
Fix:
Only effective and/or real ids are printed for the case when no user is specified.
Result:
Commands id -G and groups now show correct information about the groups.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1016163 (view as bug list) | Environment: | ||
Last Closed: | 2013-11-21 20:55:04 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1016163, 1115430 |
Description
Marc Mengel
2012-04-26 18:40:19 UTC
IMHO this is not a bug in coreutils(and therefore probably not reacted by upstream). If you want to pursue that further, than it probably should be changed in kernel/glibc. Utilities id/groups just use getgroups()/getgrouplist() for getting the group lists and can't do much with the result. I'll try to reassign it to glibc - although probably not a bug there as well. In addition - coreutils info documentation for id command states: "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." Therefore - when I edit /etc/passwd similarly to your report - change primary group to 504(which you may consider strange as well): $ id uid=502(tcsh) gid=503(tcsh) groups=504(tmpgroup),503(tcsh) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 $ id tcsh uid=502(tcsh) gid=504(tmpgroup) groups=504(tmpgroup) Hi Ondrej I think this will be fixed in coreutils after all, since it seems more useful (and matches my recollection of the intent) to print only real and effective IDs when no user name is specified. Here's the patch I'm considering: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7320#14 so I've switched the component back to coreutils. Hi Jim, thanks for the comment&patch, I haven't realized that in my check... ok, it does make sense... This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. *** Bug 1003963 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-1652.html |