summaryrefslogtreecommitdiff
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-11-05 10:51:39 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-11-15 09:52:35 -0500
commit085e3f59ea98917378eda2cb02d8b2203f13f159 (patch)
tree8c0100cdb49bd2c22f5889418554fe917ccdfaa7 /src/providers/ldap
parentadc4351a04cef89ced2dbb240180e5d00fd8dd3c (diff)
downloadsssd-085e3f59ea98917378eda2cb02d8b2203f13f159.tar.gz
sssd-085e3f59ea98917378eda2cb02d8b2203f13f159.tar.bz2
sssd-085e3f59ea98917378eda2cb02d8b2203f13f159.zip
Sanitize sysdb dn for memberof lookup
Diffstat (limited to 'src/providers/ldap')
-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;
}