dsdb: Use ldb_attr_cmp() for comparing objectclass names
[obnox/samba/samba-obnox.git] / nsswitch / winbind_nss_linux.c
index 7b1675204342e55d665bf619985ff79f6b86b8c1..9afa9d427251ba34ea9a7f36c3a38c5005910949 100644 (file)
@@ -287,7 +287,7 @@ static NSS_STATUS fill_pwent(struct passwd *result,
    Return NSS_STATUS_TRYAGAIN if we run out of memory. */
 
 static NSS_STATUS fill_grent(struct group *result, struct winbindd_gr *gr,
-                     char *gr_mem, char **buffer, size_t *buflen)
+                     const char *gr_mem, char **buffer, size_t *buflen)
 {
        char *name;
        int i;
@@ -322,7 +322,7 @@ static NSS_STATUS fill_grent(struct group *result, struct winbindd_gr *gr,
 
        /* Group membership */
 
-       if ((gr->num_gr_mem < 0) || !gr_mem) {
+       if (!gr_mem) {
                gr->num_gr_mem = 0;
        }
 
@@ -1101,6 +1101,11 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
                                continue;
                        }
 
+                       /* Skip groups without a mapping */
+                       if (gid_list[i] == (uid_t)-1) {
+                               continue;
+                       }
+
                        /* Filled buffer ? If so, resize. */
 
                        if (*start == *size) {