diff options
author | Gerald Carter <jerry@samba.org> | 2005-08-17 13:34:23 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-08-17 13:34:23 +0000 |
commit | db54100ea3382d64ba739584b1458f161c10d693 (patch) | |
tree | 24d5530e4c22897196f66b86d3d7ad6bf48f5b9a | |
parent | 536931bbfb013560ce69716f69f946c7d687f8b8 (diff) | |
download | samba-db54100ea3382d64ba739584b1458f161c10d693.tar.gz samba-db54100ea3382d64ba739584b1458f161c10d693.tar.xz samba-db54100ea3382d64ba739584b1458f161c10d693.zip |
r9361: patch from Ed Plese to fix a faulty error in winbindd
caused by users with no supplementary groups.
-rw-r--r-- | WHATSNEW.txt | 5 | ||||
-rw-r--r-- | source/nsswitch/winbindd_ads.c | 25 |
2 files changed, 17 insertions, 13 deletions
diff --git a/WHATSNEW.txt b/WHATSNEW.txt index f202187a932..eb6f0eccda8 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -93,6 +93,11 @@ o James Peach <jpeach@sgi.com> * BUG 2314: Fix const compiler warnings in the quota code. +o Ed Plese <ed@edplese.com> + * Fix faulty logic which caused winbindd to return failure + when a user passessed no supplementary groups. + + Release Notes for older release follow: diff --git a/source/nsswitch/winbindd_ads.c b/source/nsswitch/winbindd_ads.c index 50899714475..a7849e59b16 100644 --- a/source/nsswitch/winbindd_ads.c +++ b/source/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; |