1829133 Members
2325 Online
109986 Solutions
New Discussion

User group incorrect

 
Krishnan Viswanathan
Frequent Advisor

User group incorrect

I am finding inconsistencies when I execute the id command as a normal user and as a super user. For example,

$ id smshpd
uid=15900(smshpd) gid=3026(sms) groups=201(staff)

# id smshpd
uid=15900(smshpd) gid=3026(sms)

I am seeing this difference for almost all users. Additional groups/incorrect secondary groups are shown when I run the "id" command as a normal user.

Is this how hpux is supposed to work? or is this a bug ? (I tried this on 3 systems and had the same problem)

Thanks
7 REPLIES 7
Wilfred Chau_1
Respected Contributor

Re: User group incorrect

They should be the same. check your /etc/group file. run id -G smshpd, what do you see?
Krishnan Viswanathan
Frequent Advisor

Re: User group incorrect

id -G returns the gid of groups when a normal user executes it (i mean it is incorrect)
See my original message for comparision

$ id -G smshpd
3026 201

thanks
Patrick Wallek
Honored Contributor

Re: User group incorrect

Do you have /etc/logingroup linked to /etc/group?

If not do so and then see what happens.
Wilfred Chau_1
Respected Contributor

Re: User group incorrect

$ id smshpd
uid=15900(smshpd) gid=3026(sms) groups=201(staff


you must have 15900:3026 in /etc/passwd for this user. But this user is put in the staff group in /etc/group.

Krishnan Viswanathan
Frequent Advisor

Re: User group incorrect

Well, the problem is not restricted just to one user, it is across many systems and many users.. (may be a patch will solve it ?)
Mark Fenton
Esteemed Contributor

Re: User group incorrect

If the output differs only based on the user, I would suspect that either the path of root points to a different executable, or the root profile contains an alias that specifies options.

To check:

#which id
/usr/bin/id

#env ((to check search path, etc.))

hth
Darrell Allen
Honored Contributor

Re: User group incorrect

Hi,

I thought I saw what was happening. I just tested it on an 11.0 systsm and found...

When a non-superuser executes "id loginid" the output lists the uid, primary group, and then only the secondary groups that loginid AND the user executing the command are both in. When I ran the same "id loginid" command as root, all secondary groups for loginid were listed.

I tested the above as and for a couple of users and the results each time were what I list above.

Then I looked at your question again and assuming your first output is by a non-superuser and the second is by root, it's reversed from what I saw!

Go figure!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)