summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-10-16 21:17:59 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-10-17 14:37:22 -0400
commitff8bfff50bb417e564d1c1e0eaff14c080c401ed (patch)
treed924b0b4c672d23ab0cbed5256b12b5a1d0c15ba /src
parentc3d09c0095a45de1973f320ce2045ac74d4e4f83 (diff)
downloadsssd-ff8bfff50bb417e564d1c1e0eaff14c080c401ed.tar.gz
sssd-ff8bfff50bb417e564d1c1e0eaff14c080c401ed.tar.xz
sssd-ff8bfff50bb417e564d1c1e0eaff14c080c401ed.zip
Sanitize DN in sysdb_get_direct_parents
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb_search.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index b7f6a19bb..f5cd2cf73 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -853,6 +853,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
{
errno_t ret;
const char *dn;
+ char *sanitized_dn;
struct ldb_dn *basedn;
static const char *group_attrs[] = { SYSDB_NAME, NULL };
const char *member_filter;
@@ -881,9 +882,14 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
goto done;
}
+ ret = sss_filter_sanitize(tmp_ctx, dn, &sanitized_dn);
+ if (ret != EOK) {
+ goto done;
+ }
+
member_filter = talloc_asprintf(tmp_ctx, "(&(%s=%s)(%s=%s))",
SYSDB_OBJECTCLASS, SYSDB_GROUP_CLASS,
- SYSDB_MEMBER, dn);
+ SYSDB_MEMBER, sanitized_dn);
if (!member_filter) {
ret = ENOMEM;
goto done;