diff options
author | Sumit Bose <sbose@redhat.com> | 2013-08-07 12:12:48 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-19 22:32:34 +0200 |
commit | fd04fbbf93d33db729404cdc4408f59226025ea6 (patch) | |
tree | 91a9261a044268d07945da42a1e55c6b339fc12f | |
parent | 15b5d885e28afcd6c3c19f900eea2a8e00c3e6d3 (diff) | |
download | sssd-fd04fbbf93d33db729404cdc4408f59226025ea6.tar.gz sssd-fd04fbbf93d33db729404cdc4408f59226025ea6.tar.bz2 sssd-fd04fbbf93d33db729404cdc4408f59226025ea6.zip |
save_rfc2307bis_user_memberships: use fq names for subdomains
For subdomains the group names must be expanded to fully qualified names
to be able to find existing groups or properly add new ones.
-rw-r--r-- | src/providers/ldap/sdap_async_initgroups.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c index 513de274..9a46dc9b 100644 --- a/src/providers/ldap/sdap_async_initgroups.c +++ b/src/providers/ldap/sdap_async_initgroups.c @@ -1984,6 +1984,8 @@ errno_t save_rfc2307bis_user_memberships( char **add_groups; char **del_groups; bool in_transaction = false; + size_t c; + char *tmp_str; TALLOC_CTX *tmp_ctx = talloc_new(NULL); if(!tmp_ctx) { @@ -2019,6 +2021,20 @@ errno_t save_rfc2307bis_user_memberships( if (ret != EOK) { goto error; } + + if (IS_SUBDOMAIN(state->dom)) { + for (c = 0; ldap_grouplist[c] != NULL; c++) { + tmp_str = sss_tc_fqname(ldap_grouplist, state->dom->names, + state->dom, ldap_grouplist[c]); + if (tmp_str == NULL) { + DEBUG(SSSDBG_OP_FAILURE, ("sss_tc_fqname failed.\n")); + ret = ENOMEM; + goto error; + } + talloc_free(ldap_grouplist[c]); + ldap_grouplist[c] = tmp_str; + } + } } /* Find the differences between the sysdb and ldap lists |