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:33:41 -0400
commit7655e45f846070f103e8e148bd7b5714bd8f176a (patch)
tree358add281a3068e4cf5b317c27d857a013b1e40e
parent818ce8b212ab93a249b9d588dddd14085c17e414 (diff)
downloadsssd-7655e45f846070f103e8e148bd7b5714bd8f176a.tar.gz
sssd-7655e45f846070f103e8e148bd7b5714bd8f176a.tar.xz
sssd-7655e45f846070f103e8e148bd7b5714bd8f176a.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);