Hello,
I recently noticed that when I type id at the command prompt it displays all
supplement groups that the user is in twice. Like this:
root:~> id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),1(bin),
2(daemon),3(sys),4(adm),6(disk),10(wheel)
Pursuing the annoyance, I found that typing id <username> works correctly:
root:~> id root
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Doing an ' strace -o debug.txt id ' and an ' strace -o debug2.txt id root ', I
found one distinct difference between the two that I could understand. ' id
root ' does not call the getgroups() function but ' id ' does.
root:~> strace -o debug.txt id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),1(bin),
2(daemon),3(sys),4(adm),6(disk),10(wheel)
root:~> cat debug.txt |grep getgroups
getgroups(0, 0xbffffab4) = 13
getgroups(13, [65536, 196610, 393220, 65546, 196610, 393220, 134479882,
1074368946, 13, 0, 134529856, 1074736864, 1074368932]) = 13
The first getgroups() call returns 13 and the number of groups that it displays
for root are also 13 even though root is only in 7 groups (including its own).
This is why I believe there is something strange happening in getgroups() where
it likes to double the number of supplement groups that the user is in and then
have id display each one over again.
I first noticed this "annoyance" using sh-utils 1.16. I upgraded to sh-utils
2.0 and it did not change. I am running kernel version 2.2.14 with glibc 2.1.2.
I would appreciate any input you have on this matter. Since i recently upgraded
my glibc libraries from the source, I could have made a mistake somewhere, but
I do not know where to look.
Thank You,
--
You don't move to Edina, you achieve Edina.
-- Guindon