Skip to main content.

2001-Feb-21

I am trying to figure out if there is any limitation on how many users can be part of a supplemental groups.

I have found references to NGROUPS_MAX, but I believe this refers to how many groups one user can be apart of. I want to know how many users can be part of a group (not login groups), i.e.:

groupname: user1, user2, user3, user4, ...

So I am looking at /usr/src/lib/libc/gen/getgrent.c.

It appears that a group can only as many users that can fit on one 1024 character line. Also, I don't see any way to wrap a group entry to multiple lines. (If it is longer than 1024 characters, then the line -- the group entry -- is not used.)

I also see a reference to MAXGRP which is defined to 200. It looks like a group entry can only have up to 200 members (users).

A supplementary group can have up to 200 users as long as the line is less than 1024-characters long.

I am not sure why "200" is the max number of groups.

According to C. Kane, you can duplicate group names and IDs (at least with NIS):

group1:*:16384:user1,user2,user3
group1:*:16384:user4,user5,user6
He also says the maximum limit is currently 960 characters per line: "as the actual length seems to be the key plus the data in the database on our systems (which are not NetBSD, by the way). If the biggest group name is 64 characters, then line length of 960 + key length of 64 equals 1024."