[OpenAFS-devel] interesting issue with setgroups wrapper...

Derek Atkins warlord@MIT.EDU
23 May 2002 11:23:35 -0400


Does setgroups (0, x) wind up calling initgroups()?

-derek

"Neulinger, Nathan" <nneul@umr.edu> writes:

> I'm not sure if this has always been this way, but it is definately an
> issue with building latest samba... 
> 
> Test program:
> #include <unistd.h>
> #include <stdio.h>
> #include <grp.h>
> 
> int main(int argc, char *argv[])
> {
>         int x[5] = {0,0,0,0,0};
>         system("id");
>         setgroups(0, x);
>         system("id");
> }
> 
> Test output:
> uid=0(root) gid=0(root) groups=34479,41855,0(root),7567(dba)
> uid=0(root) gid=0(root)
> 
> 
> Basically, running a setgroups with an empty group list (or zero groups)
> results in the pag going away. I can't think of any time you'd _REALLY_
> want to throw away the pag. 
> 
> I'll work up a fix for this in the linux libafs, but would be interested
> in hearing if anyone else has a differing oppinion on how it should
> behave.
> 
> -- Nathan
> 
> ------------------------------------------------------------
> Nathan Neulinger                       EMail:  nneul@umr.edu
> University of Missouri - Rolla         Phone: (573) 341-4841
> Computing Services                       Fax: (573) 341-4216
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available