getgroups() gives wrong result with nss_winbind

Andreas andreas at conectiva.com.br
Thu Sep 16 22:01:59 GMT 2004


On Thu, Sep 16, 2004 at 11:48:19PM +0200, Henrik Nordstrom wrote:
> On Thu, 16 Sep 2004, Andreas wrote:
> 
> >I'm having some strange errors with group membership in samba-3.0.7 (not
> >sure about other version).
> >
> >There is this user (marcia) belonging to over 200 groups. However, when 
> >she calls
> >getgroups(2), only 64 are returned.
> 
> Maybe your OS limit is set to 64..
> 
> Try the following to verify your OS limit:
> 
> #include <unistd.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>     long ngroups_max;
>     ngroups_max = sysconf(_SC_NGROUPS_MAX);
>     printf("ngroups: %ld\n", ngroups_max);
> }

Nope.
$ ./bla
ngroups: 65536

("bla" is your little prog above)

Also:
# cat /proc/sys/kernel/ngroups_max
65536



More information about the samba-technical mailing list