summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa/ipa_s2n_exop.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-01-22 17:03:00 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-01-23 13:16:53 +0100
commitdd5ebcde05442422f39084acb49b28cf47002d1e (patch)
tree6f9127ff3c2f5d2d4a5c5bb2d8b596acbaa60cc1 /src/providers/ipa/ipa_s2n_exop.c
parentba818cc39dfe94c2b8613f4badf7912811f0f737 (diff)
downloadsssd-dd5ebcde05442422f39084acb49b28cf47002d1e.tar.gz
sssd-dd5ebcde05442422f39084acb49b28cf47002d1e.tar.xz
sssd-dd5ebcde05442422f39084acb49b28cf47002d1e.zip
IPA: properly handle mixed-case trusted domains
In the SSSD cache domain names are handled case-sensitive. As a result fully-qualified names in RDN contain the domain part in the original spelling. When IPA client lookup up group-memberships on the IPA server via the extdom plugin the names returned are all lower case. To make sure new DNs are generated correctly the domain part must adjusted. Related to https://fedorahosted.org/sssd/ticket/2159 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers/ipa/ipa_s2n_exop.c')
-rw-r--r--src/providers/ipa/ipa_s2n_exop.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index a9c2f1ae3..997d0dce8 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -1749,6 +1749,7 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
bool in_transaction = false;
int tret;
struct sysdb_attrs *gid_override_attrs = NULL;
+ char ** exop_grouplist;
tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) {
@@ -2000,8 +2001,19 @@ static errno_t ipa_s2n_save_objects(struct sss_domain_info *dom,
goto done;
}
- ret = diff_string_lists(tmp_ctx, attrs->groups, sysdb_grouplist,
- &add_groups, &del_groups, NULL);
+ /* names returned by extdom exop will be all lower case, since
+ * we handle domain names case sensitve in the cache we have
+ * to make sure we use the right case. */
+ ret = fix_domain_in_name_list(tmp_ctx, dom, attrs->groups,
+ &exop_grouplist);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE, "fix_domain_name failed.\n");
+ goto done;
+ }
+
+ ret = diff_string_lists(tmp_ctx, exop_grouplist,
+ sysdb_grouplist, &add_groups,
+ &del_groups, NULL);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "diff_string_lists failed.\n");
goto done;