1834750 Members
3055 Online
110070 Solutions
New Discussion

Order in /etc/group

 
SOLVED
Go to solution
Thamm
Occasional Advisor

Order in /etc/group

Hi.
We have a user, let us call him "pete" who has to be included into a lot of groups.
Now I added him into a new group (group20).
After a "su - peter" "groups" gives:
peter group2 group2 group3 ... group20
Despite the fact a "ll" of a directory, which belongs to group20 with permissions 770 does not work.

Now I changed the order of /etc/group: I put group20 into the the first lines.
Result of "groups"-command:
peter group20 group2 group3 ...
Now the "ll" works.
What is the reason of this behaviour?

Regards,
Stefan.

6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Order in /etc/group

Stefan,

From the man page for "group":

"The file /etc/group exists to supply names for each
group, and to support changing groups by means of the newgrp utility
(see newgrp(1))."

In order from Pete to benefit from the additional groups he belongs to, he would have to issue the newgrp command. Try that!


Pete

Pete
Kevin Wright
Honored Contributor

Re: Order in /etc/group

pwgrd perhaps? The order of /etc/group is independant. You should not list a user in his PGID field in this file.
Steven E. Protter
Exalted Contributor

Re: Order in /etc/group

With HP-UX 11.11 there is a hard limit on how many groups a user can be in. That is 20. It can not be changed. You may be hitting that limit.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Order in /etc/group

My best guess is that you have exceeded the maximum number of allowable groups for a user. See the value 'NGROUPS' as defined in /usr/include/sys/param.h. By rearranging the entry you have basically robbed Peter to pay Paul so that now another group "fell off the end".


I assume that you have linked /etc/group and /etc/logingroup so that no newgrp command is required.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: Order in /etc/group

Hi Stefan,

If I remember correctly, we ran into this limit sometime back. It was allowing only a maximum of 20 groups.

When you changed the order of the group, will "Pete" be able to access files belonging to group 'group19' now the last group?. If not, then you are hitting that limit.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Thamm
Occasional Advisor

Re: Order in /etc/group

Hi,
I asked HP.
The maximim 20 is hard coded.

In 2005 they will change that value.

Thank you.


Stefan.