From 085e3f59ea98917378eda2cb02d8b2203f13f159 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 5 Nov 2010 10:51:39 -0400 Subject: Sanitize sysdb dn for memberof lookup --- src/providers/ldap/sdap_async_accounts.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/providers/ldap') 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; } -- cgit