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-23 06:48:28 -0400
commiteb88e52a6fa27bd0bead9a839cccb6cb681c7c36 (patch)
tree64de04e862f4914d38185ee0a4382c30042cd143
parent9a8bdc742fd3d894ad8a3d3d61bf2887d829390d (diff)
downloadsssd-eb88e52a6fa27bd0bead9a839cccb6cb681c7c36.tar.gz
sssd-eb88e52a6fa27bd0bead9a839cccb6cb681c7c36.tar.xz
sssd-eb88e52a6fa27bd0bead9a839cccb6cb681c7c36.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);