diff options
author | Jeremy Allison <jra@samba.org> | 2007-02-27 20:34:10 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:14 -0500 |
commit | 2546b63f732226e04505b3903f22b666ab161a96 (patch) | |
tree | 35deef5058b1053195824efa290c5ba9af82fa8e /source3/nsswitch | |
parent | 2b5d317af191256abea65328ce8d8a8833dcae69 (diff) | |
download | samba-2546b63f732226e04505b3903f22b666ab161a96.tar.gz samba-2546b63f732226e04505b3903f22b666ab161a96.tar.bz2 samba-2546b63f732226e04505b3903f22b666ab161a96.zip |
r21566: If we're going to be broken, at least be *consistently*
broken :-). This will do until Simo fixes the escape
calls properly.
Jeremy.
(This used to be commit b7d91ec1b20f8d58903a3283f7789a30041461be)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_ads.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index 9c8f23b1cf..7fcdec0b7d 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -607,6 +607,7 @@ static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain, const char *attrs[] = {"memberOf", NULL}; size_t num_groups = 0; DOM_SID *group_sids = NULL; + char *escaped_dn; int i; DEBUG(3,("ads: lookup_usergroups_memberof\n")); @@ -618,9 +619,16 @@ static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain, goto done; } - rc = ads_search_retry_extended_dn(ads, &res, user_dn, attrs, + if (!(escaped_dn = escape_ldap_string_alloc(user_dn))) { + status = NT_STATUS_NO_MEMORY; + goto done; + } + + rc = ads_search_retry_extended_dn(ads, &res, escaped_dn, attrs, ADS_EXTENDED_DN_HEX_STRING); + SAFE_FREE(escaped_dn); + if (!ADS_ERR_OK(rc) || !res) { DEBUG(1,("lookup_usergroups_memberof ads_search member=%s: %s\n", user_dn, ads_errstr(rc))); |