summaryrefslogtreecommitdiff
path: root/src/providers/ldap/sdap_async_accounts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ldap/sdap_async_accounts.c')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index ab599f8c..f4d6d052 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -1915,6 +1915,7 @@ static void sdap_initgr_rfc2307_process(struct tevent_req *subreq)
struct ldb_message_element *groups;
size_t count;
const char *attrs[2];
+ char *clean_dn;
int ret;
int i;
@@ -1967,14 +1968,23 @@ static void sdap_initgr_rfc2307_process(struct tevent_req *subreq)
/* Get a list of the groups by groupname only */
for (i=0; i < groups->num_values; i++) {
+ ret = sysdb_dn_sanitize(state,
+ (const char *)groups->values[i].data,
+ &clean_dn);
+ if (ret != EOK) {
+ tevent_req_error(req, ret);
+ return;
+ }
+
ret = sysdb_group_dn_name(state->sysdb,
sysdb_grouplist,
- (const char *)groups->values[i].data,
+ clean_dn,
&sysdb_grouplist[i]);
if (ret != EOK) {
tevent_req_error(req, ENOMEM);
return;
}
+ talloc_zfree(clean_dn);
}
sysdb_grouplist[groups->num_values] = NULL;
}