summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-03-21 20:48:06 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-03-22 15:34:42 -0400
commit2fb62d06da345b5adb3357373c29ce9e212c5640 (patch)
tree2c002785449392186a812ca51cd6e2d523e4cf1d
parent67fcf24cb4cea67fbcc2f499f37ebbf80af7e099 (diff)
downloadsssd-2fb62d06da345b5adb3357373c29ce9e212c5640.tar.gz
sssd-2fb62d06da345b5adb3357373c29ce9e212c5640.tar.xz
sssd-2fb62d06da345b5adb3357373c29ce9e212c5640.zip
Sanitize DN when searching the original DN in the cache
-rw-r--r--src/providers/ldap/sdap_async_accounts.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 4872416bd..5c2078e7d 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -512,13 +512,20 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx,
struct ldb_message **msgs;
size_t num_msgs;
int ret;
+ char *sanitized_dn;
tmpctx = talloc_new(NULL);
if (!tmpctx) {
return ENOMEM;
}
- filter = talloc_asprintf(tmpctx, "%s=%s", SYSDB_ORIG_DN, orig_dn);
+ ret = sss_filter_sanitize(tmpctx, orig_dn, &sanitized_dn);
+ if (ret != EOK) {
+ ret = ENOMEM;
+ goto done;
+ }
+
+ filter = talloc_asprintf(tmpctx, "%s=%s", SYSDB_ORIG_DN, sanitized_dn);
if (!filter) {
ret = ENOMEM;
goto done;
@@ -530,6 +537,7 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx,
goto done;
}
+ DEBUG(9, ("Searching cache for [%s].\n", sanitized_dn));
ret = sysdb_search_entry(tmpctx, ctx,
base_dn, LDB_SCOPE_SUBTREE, filter, no_attrs,
&num_msgs, &msgs);