summaryrefslogtreecommitdiffstats
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:52:18 -0400
commit48ef7b65db0fb71fbdc0eea6610699b166f50040 (patch)
tree7277c77c5925c8cb3d3427da50d81f4d45975cb3
parent08a5ec84f3ae8e4000520c72d906148d771e7ebf (diff)
downloadsssd-48ef7b65db0fb71fbdc0eea6610699b166f50040.tar.gz
sssd-48ef7b65db0fb71fbdc0eea6610699b166f50040.tar.xz
sssd-48ef7b65db0fb71fbdc0eea6610699b166f50040.zip
Sanitize DN in sysdb_get_direct_parents
-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 9c386cae6..6386795c6 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -899,6 +899,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;
@@ -927,9 +928,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;