Subject: Re: bin/11047: newgrp is missing
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Tim Bandy <bandy@timn8r.org>
List: tech-userlevel
Date: 04/27/2002 22:37:42
After listening to the discussion for a while, it seems like there are
two good reasons to have a newgrp command, even if the vast majority
of systems will not need it.  Are both of these statements correct?

1) newgrp is needed for posix compliance.

2) newgrp is needed to get around a limitation in the maximum number
   of groups a user process may be in at any one time.

I did a small amount of looking around and found this:
/usr/include/sys/param.h:#define        NGROUPS         NGROUPS_MAX
/* max number groups */
/usr/include/sys/syslimits.h:#define    NGROUPS_MAX                16
/* max supplemental group id's */

So I'm guessing that users are currently prohibited from being in more
than 16 groups at one time, which may be a problem on some systems.  I
tried to verify this, and added myself to 17 groups, and had a problem
logging in via sshd.  I'll do some more investigation on this and
send-pr when I can reliably reproduce it.

-- 
Tim Bandy (bandy@timn8r.org)

Thank goodness modern convenience is a thing of the remote future.
                -- Pogo, by Walt Kelly