summaryrefslogtreecommitdiff
path: root/src
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:16 -0400
commit6a013ce214efb30c9474054672bb6307f2940104 (patch)
tree3a71f3a314e55ead3f89932be1be61f212c39151 /src
parent5ec42a5eaebeb5f2b8dcd450da79aad9c10a26b0 (diff)
downloadsssd-6a013ce214efb30c9474054672bb6307f2940104.tar.gz
sssd-6a013ce214efb30c9474054672bb6307f2940104.tar.bz2
sssd-6a013ce214efb30c9474054672bb6307f2940104.zip
Sanitize DN when searching the original DN in the cache
Diffstat (limited to 'src')
-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 4872416b..5c2078e7 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);