getgroups() gives wrong result with nss_winbind

Andreas andreas at conectiva.com.br
Fri Sep 17 15:30:57 GMT 2004


On Fri, Sep 17, 2004 at 11:43:06AM -0300, Andreas wrote:
> --- winbind_nss_linux.c.orig    2004-09-17 11:40:18.717985984 -0300
> +++ winbind_nss_linux.c 2004-09-17 11:41:15.191400720 -0300
> @@ -825,6 +825,11 @@
> 
>         if (ret == NSS_STATUS_SUCCESS) {
>                 int num_gids = response.data.num_entries;
> +               if (num_gids >= (int)(*size)) {
> +                       ret = NSS_STATUS_TRYAGAIN;
> +                       *start = (long int) (num_gids);
> +                       goto done;
> +               }
>                 gid_t *gid_list = (gid_t *)response.extra_data;
> 
>                 /* Copy group list to client */
 
 This didn't work as intended, actually. I'm still learning the NSS basics... :(
I'm playing with errnop=ERANGE now.



More information about the samba-technical mailing list