summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-11-15 23:03:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:17 -0500
commit1c20bb833cddcc86d620f45c33d90e027178ea1a (patch)
treed68eca6ae7efecc5f00023a1be9e6885365121f4
parentb5eeca9f7062164bc7f9761395823df3f584d136 (diff)
downloadsamba-1c20bb833cddcc86d620f45c33d90e027178ea1a.tar.gz
samba-1c20bb833cddcc86d620f45c33d90e027178ea1a.tar.bz2
samba-1c20bb833cddcc86d620f45c33d90e027178ea1a.zip
r3776: Fix for bug #2038 from Johann Hanne <jhml@gmx.net>. Don't check
for no groups after every lookup - move check to the end as we should only fail if all lookups fail. Jeremy. (This used to be commit 3b40c1e4365f37b967e14be02c6aa52893a80f51)
-rw-r--r--source3/nsswitch/winbindd_group.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c
index eec0f72217..7eb0585c37 100644
--- a/source3/nsswitch/winbindd_group.c
+++ b/source3/nsswitch/winbindd_group.c
@@ -1089,9 +1089,6 @@ enum winbindd_result winbindd_getgroups(struct winbindd_cli_state *state)
add_gids_from_group_sid(&info3->other_sids[i].sid,
&gid_list, &num_gids);
-
- if (gid_list == NULL)
- goto done;
}
for (i = 0; i < info3->num_groups2; i++) {
@@ -1103,9 +1100,6 @@ enum winbindd_result winbindd_getgroups(struct winbindd_cli_state *state)
add_gids_from_group_sid(&group_sid, &gid_list,
&num_gids);
-
- if (gid_list == NULL)
- goto done;
}
SAFE_FREE(info3);
@@ -1123,12 +1117,13 @@ enum winbindd_result winbindd_getgroups(struct winbindd_cli_state *state)
for (i = 0; i < num_groups; i++) {
add_gids_from_group_sid(user_grpsids[i],
&gid_list, &num_gids);
-
- if (gid_list == NULL)
- goto done;
}
}
+ /* We want at least one group... */
+ if (gid_list == NULL)
+ goto done;
+
remove_duplicate_gids( &num_gids, gid_list );
/* Send data back to client */