summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-01 05:20:11 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-01 05:20:11 +0000
commitc2b134cc3b67d48961226cbfac6ea3a2fc7cc1a6 (patch)
tree3ca8971139282d99baed4a833162fc94c0f98911 /source3/nsswitch
parent1454c1c99ab87e216dea1871b53c51ce7e548ba5 (diff)
downloadsamba-c2b134cc3b67d48961226cbfac6ea3a2fc7cc1a6.tar.gz
samba-c2b134cc3b67d48961226cbfac6ea3a2fc7cc1a6.tar.bz2
samba-c2b134cc3b67d48961226cbfac6ea3a2fc7cc1a6.zip
Always escape ldap filter strings. Escaping code was from pam_ldap, but I'm to
blame for the realloc() stuff. Plus a couple of minor updates to libads. Andrew Bartlett (This used to be commit 34b2e558a4b3cfd753339bb228a9799e27ed8170)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_ads.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 261c2f2237..7cea4aa716 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -346,10 +346,17 @@ static BOOL dn_lookup(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
ADS_STATUS rc;
uint32 atype;
DOM_SID sid;
+ char *escaped_dn = escape_ldap_string_alloc(dn);
+
+ if (!escaped_dn) {
+ return False;
+ }
asprintf(&exp, "(distinguishedName=%s)", dn);
rc = ads_search_retry(ads, &res, exp, attrs);
- free(exp);
+ SAFE_FREE(exp);
+ SAFE_FREE(escaped_dn);
+
if (!ADS_ERR_OK(rc)) {
goto failed;
}