Hide Forgot
Description of problem: The "id" and "groups" commands report that you have whatever group is listed as your primary group in /etc/passwd, regardless whether you currently have that group id. Version-Release number of selected component (if applicable): coreutils-8.4-13.el6.i686 How reproducible: Easily Steps to Reproduce: 1. in one window: su - mysql 2. in another window: su - 3. in the mysql window run "id" 4. in the root window, edit /etc/passwd and change mysql's primary group to 123456 5. in the mysql window, run "id" again 6. put mysql's group id back in /etc/passwd. Actual results: in mysql window, you get: ------------------------------- # su - mysql -bash-4.1$ id uid=27(mysql) gid=27(mysql) groups=27(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 -bash-4.1$ id uid=27(mysql) gid=27(mysql) groups=123456,27(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 --------------------------------- note how we appear to have gained group 123456. Expected results: id should print the same result, as our groups have not changed: ---------------------------------- # su - mysql -bash-4.1$ id uid=27(mysql) gid=27(mysql) groups=27(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 -bash-4.1$ id uid=27(mysql) gid=27(mysql) groups=27(mysql) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 ----------------------------------- Additional info: Appears to have been reported, but not acted on, before: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7320
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