summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-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 b7f6a19b..f5cd2cf7 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;