1826388 Members
4366 Online
109692 Solutions
New Discussion

LINE_MAX limit

 
SOLVED
Go to solution
Tibi Baraboi_1
Advisor

LINE_MAX limit

I have to add more than 1024 users in a specific group but because of LINE_MAX limit from file I cannot. Do you have any suggestions, workarounds?
What I can doo for having more than 1024 users in one groups?
(OS: HP-UX 11)

Thank you
5 REPLIES 5
Stefan Farrelly
Honored Contributor
Solution

Re: LINE_MAX limit

Armin Feller
Honored Contributor

Re: LINE_MAX limit

Hi,

as an aside, in 11.0, the group(4) man page indicates:
The length of each line in /etc/group is limited to LINE_MAX, as defined in . Because of this limit, users should not be listed in their primary group - only in any secondary groups. If necessary, primary group inventory can be calculated via the /etc/passwd file.

# more /etc/passwd
users::20:root, ..., hundreds more users.
users::20:rooty, ..., hundreds more users.
users::20:rooter, ..., hundreds more users.
.
.
.
All users listed in each of the additional entries for the users group will have to execute the newgrp() command to access the files and directories restricted to the group users UNLESS the /etc/logingroup linked file is created:

# ln -s /etc/group /etc/logingroup

Best regards,
Armin
Tibi Baraboi_1
Advisor

Re: LINE_MAX limit

One small ammendament. We use NIS too so if I will manually split a long line in two parts I will have also to recreate the maps I guess.

Armin,
what exactly means "users should not be listed in their primary group" they are logically added but are not displayed?
Armin Feller
Honored Contributor

Re: LINE_MAX limit

If creating a second group and giving it the same Group ID (GID) as the first group will not work, so they should not be listed in their primary group.

Regards ...
Armin
Robert-Jan Goossens
Honored Contributor

Re: LINE_MAX limit

Hi,

You can solve this by adding a second or more groups with the same groupid.

oracle::1000:oracle,composer
oracle1::1000:usera,userb,etc
oracle2::1000:userx,usery,etc

Kind regards,

Robert-Jan.