getgroups() gives wrong result with nss_winbind

tridge at tridge at
Thu Sep 16 23:17:09 GMT 2004


 > #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);
 > }

That limit is not used on all operating systems. For example, glibc on
Linux does not use sysconf for the limit (there are patches to fix

You can find a program that properly tests the max groups limit at:

Cheers, Tridge

More information about the samba-technical mailing list