summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-17 13:34:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:34 -0500
commit59f6f650eca5b2534b17cb1c0d67d8476ccb019b (patch)
treeb3812d192f6d7d4b8b7ed8cd683e25f3c1cf4f3d
parente906c370e5b0037cd1379f72c20e400ac1630db2 (diff)
downloadsamba-59f6f650eca5b2534b17cb1c0d67d8476ccb019b.tar.gz
samba-59f6f650eca5b2534b17cb1c0d67d8476ccb019b.tar.bz2
samba-59f6f650eca5b2534b17cb1c0d67d8476ccb019b.zip
r9361: patch from Ed Plese to fix a faulty error in winbindd
caused by users with no supplementary groups. (This used to be commit dbdf8c631531c499965630bfae3b381f3dc8314a)
-rw-r--r--source3/nsswitch/winbindd_ads.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 5089971447..a7849e59b1 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -499,28 +499,27 @@ static NTSTATUS lookup_usergroups_alt(struct winbindd_domain *domain,
}
count = ads_count_replies(ads, res);
- if (count == 0) {
- DEBUG(5,("lookup_usergroups: No supp groups found\n"));
-
- status = ads_ntstatus(rc);
- goto done;
- }
*user_sids = NULL;
*num_groups = 0;
+ /* always add the primary group to the sid array */
add_sid_to_array(mem_ctx, primary_group, user_sids, num_groups);
- for (msg = ads_first_entry(ads, res); msg;
- msg = ads_next_entry(ads, msg)) {
- DOM_SID group_sid;
+ if (count > 0) {
+ for (msg = ads_first_entry(ads, res); msg;
+ msg = ads_next_entry(ads, msg)) {
+ DOM_SID group_sid;
- if (!ads_pull_sid(ads, msg, "objectSid", &group_sid)) {
- DEBUG(1,("No sid for this group ?!?\n"));
- continue;
+ if (!ads_pull_sid(ads, msg, "objectSid", &group_sid)) {
+ DEBUG(1,("No sid for this group ?!?\n"));
+ continue;
+ }
+
+ add_sid_to_array(mem_ctx, &group_sid, user_sids,
+ num_groups);
}
- add_sid_to_array(mem_ctx, &group_sid, user_sids, num_groups);
}
status = (user_sids != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY;