Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 1995 13:42:22 -0500
From:      Garrett Wollman <wollman@halloran-eldar.lcs.mit.edu>
To:        jim@reptiles.org (Jim Mercer)
Cc:        bugs@freebsd.org, hackers@freebsd.org
Subject:   2.0-R bug in setgroups() or sys/nfs/nfs_socket.c?
Message-ID:  <9501061842.AA07232@halloran-eldar.lcs.mit.edu>
In-Reply-To: <m0rQIOZ-00033zC@iguana.reptiles.org>
References:  <m0rQIOZ-00033zC@iguana.reptiles.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Fri, 6 Jan 1995 12:24:10 -0500 (EST), jim@reptiles.org (Jim Mercer) said:

> #ifdef  HAVE_SETGROUPS
>     /* clear out all extra groups.  We don't want to have to deal with them */
>     {
>         gid_t dummy;
>         (void) setgroups(0, &dummy);
>     }
> #endif  /* HAVE_SETGROUPS */

> i cannot beleive that these other systems would behave the same (ie. panicing
> on NFS if no gid).

I suspect that, on those systems, the effective GID is not stored in
groups[0].

> should setgroups() set at least one group (ie. from the gid field in 
> /etc/passwd)?

I believe that setgroups() should enforce a requirement for at least
one group.  I'm not sure whether it should give an error and refuse to
do anything, or just silently preserve the egid.

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence.  We like people
MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9501061842.AA07232>