On Fri, Sep 17, 2004 at 12:43:02AM +0200, Henrik Nordstrom wrote:
> What do you get if you run the following (as root) giving her unix login
> as argument:
>
> #include
> #include
> #include
> #include
> #include
>
> int main(int argc, char **argv)
> {
> struct passwd *pw = getpwnam(argv[1]);
> int rc;
>
> rc = initgroups(argv[1], pw->pw_gid);
> assert(rc == 0);
>
> rc = getgroups(0, NULL);
>
> printf("Number of groups for %s: %d\n", argv[1], rc);
> }


[root@pandora 1]# ./test andreas
Number of groups for andreas: 4

[root@pandora 1]# ./test DOMAIN\\marcia
Number of groups for DOMAIN\marcia: 64

"testando" is a local user which is a member of 100 local
supplementary groups:

[root@pandora 1]# ./test testando
Number of groups for testando: 101