There was a summary regarding the max. number of users in one group from
another person in this list some days ago. After reading this summary, I
still had some questions; most of these I was able to answer myself.
One question remained open. I asked:
> Also, I cannot come up why there should be a limit on the number of users
> per group. What is the limiting factor here?
Answers came in from:
haymanr_at_icefog.uacn.alaska.edu
"Guy Helmer" <ghelmer_at_alpha.dsu.edu>
"Anthony D'Atri" <aad_at_statsci.com>
Randy Hayman wrote:
> The limit is the size of the buffer which holds the username entries in the
> group file, consequently the line size of the group entry in /etc/group.
Guy Helmer explained the problem more detailed:
> There is a limit on the line length (1024 bytes) and # of users per group
> (200) in the BSD Net-2 getgrent.c [which contains getgrent(3) / getgrnam(3)
> / getgrgid(3)] source code, which is probably a close relative to the code
> used in OSF/1. OSF/1 also has a set of related functions that allow the
> caller to provide a longer line buffer, but there isn't any indication in
> the manual page for getgrent(3) of a limit on the number of users per
> group...
The getgrent_r function is mainly provided as a reentrant version of
getgrent so it can be used in a multithreaded environment, according to the
manual page.
> The BSD Net-2 getgrent.c code contains a neat little feature where it
> completely skips lines that are longer than the acceptable line length;
> if OSF/1 works the same way, one would probably be in for a surprise if
> she/he exceeded the line length limit.
Anthony D'Atri suggested a workaround for this limitation. In my original
mail to the list I wrote
>I was not aware of the fact that group names can be used in field 4 of the
>group file. The documentation of group(4) only mentions user names. Does
>this really work?
His suggestion:
> Not to my knowledge. If you want to be safe, just make multiple groups
> with the same gid and different names.
Kristian
Received on Thu Jun 01 1995 - 17:17:48 NZST