summaryrefslogtreecommitdiff
path: root/src/responder/common
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-09-28 11:22:59 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-10-01 21:45:22 +0200
commitaac3ca699a09090072ae4d68bdda8dec990ae393 (patch)
tree71212910107a41b5ceaca0e9af27f5d971e744d8 /src/responder/common
parent1542b85f13d72329685bdd97aa879c36d11f81be (diff)
downloadsssd-aac3ca699a09090072ae4d68bdda8dec990ae393.tar.gz
sssd-aac3ca699a09090072ae4d68bdda8dec990ae393.tar.bz2
sssd-aac3ca699a09090072ae4d68bdda8dec990ae393.zip
Use flat name for master domain as well
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/responder_common.c4
-rw-r--r--src/responder/common/responder_get_domains.c15
2 files changed, 18 insertions, 1 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 2f8cd84d..4fa81909 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -878,7 +878,9 @@ responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx,
int i;
for (dom = rctx->domains; dom; dom = dom->next) {
- if (strcasecmp(dom->name, domain) == 0) {
+ if (strcasecmp(dom->name, domain) == 0 ||
+ (dom->flat_name != NULL &&
+ strcasecmp(dom->flat_name, domain) == 0)) {
ret_dom = dom;
break;
}
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index a98e6634..aff06e63 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -233,6 +233,7 @@ static errno_t get_domains_done(struct tevent_req *req)
struct sss_domain_info **new_sd_list = NULL;
size_t subdomain_count;
struct sysdb_subdom **subdomains;
+ struct sysdb_subdom *master_info;
state = tevent_req_data(req, struct sss_dp_domains_info);
domain = state->dom;
@@ -280,6 +281,20 @@ static errno_t get_domains_done(struct tevent_req *req)
--c;
}
+ if (domain->flat_name == NULL) {
+ ret = sysdb_master_domain_get_info(domain, domain->sysdb, &master_info);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_FUNC_DATA, ("sysdb_master_domain_get_info " \
+ "failed.\n"));
+ goto done;
+ }
+
+ domain->flat_name = talloc_strdup(domain, master_info->flat_name);
+ talloc_free(master_info);
+ DEBUG(SSSDBG_TRACE_LIBS, ("Adding flat name [%s] to domain [%s].\n",
+ domain->flat_name, domain->name));
+ }
+
errno = 0;
ret = gettimeofday(&domain->subdomains_last_checked, NULL);
if (ret == -1) {