summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-04-17 18:22:10 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-05-06 10:40:13 +0200
commit226224c91971247f60a86d9c46dd1402f5c29e8a (patch)
tree27bb2ec5b9602312c94403ba1df0539311ed9720
parenteaf656843831d579f30f94154d88aba2201c1712 (diff)
downloadsssd-226224c91971247f60a86d9c46dd1402f5c29e8a.tar.gz
sssd-226224c91971247f60a86d9c46dd1402f5c29e8a.tar.xz
sssd-226224c91971247f60a86d9c46dd1402f5c29e8a.zip
IPA: do not add domain name unconditionally
Depending on the server-side configuration the extdom plugin can return short or fully qualified names for IPA objects. The client must handle the names according to its own configuration and not add the domain part of the fully-qualified name unconditionally. Resolves https://fedorahosted.org/sssd/ticket/2647 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 3fe2e555edd3963d72483600e5d9616873afd00a)
-rw-r--r--src/providers/ipa/ipa_s2n_exop.c2
-rw-r--r--src/tests/cmocka/test_utils.c1
-rw-r--r--src/util/domain_info_utils.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index daebd6885..fa00691af 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -1724,6 +1724,8 @@ static errno_t get_groups_dns(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom,
ret = ENOMEM;
goto done;
}
+
+ DEBUG(SSSDBG_TRACE_ALL, "Added [%s][%s].\n", name_list[c], dn_list[c]);
}
*_dn_list = talloc_steal(mem_ctx, dn_list);
diff --git a/src/tests/cmocka/test_utils.c b/src/tests/cmocka/test_utils.c
index 4cc6ec85a..933e7cd46 100644
--- a/src/tests/cmocka/test_utils.c
+++ b/src/tests/cmocka/test_utils.c
@@ -1063,6 +1063,7 @@ void test_fix_domain_in_name_list(void **state)
sd->name = talloc_strdup(sd, "TesT.CasE.DoM");
assert_non_null(sd->name);
sd->names = dom->names;
+ sd->fqnames = true;
DLIST_ADD(dom->subdomains, sd);
sd->parent = dom;
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index e76c1cefb..9fb2110eb 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -831,7 +831,7 @@ errno_t fix_domain_in_name_list(TALLOC_CTX *mem_ctx,
goto done;
}
- out[c] = sss_tc_fqname(out, head->names, out_domain, in_name);
+ out[c] = sss_get_domain_name(out, in_name, out_domain);
}
if (out[c] == NULL) {