summaryrefslogtreecommitdiffstats
path: root/src/responder/common/responder_get_domains.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-11-26 14:31:47 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-08 14:42:56 +0100
commitbaac15d2f47bcc0368d569804792d3eadca341f7 (patch)
treed96c8d5f9c7a118b7ce0d36e1cd4cb6e5bd0660d /src/responder/common/responder_get_domains.c
parent6f504738cad1ee9daa1bd6eec721caceef65f21d (diff)
downloadsssd-baac15d2f47bcc0368d569804792d3eadca341f7.tar.gz
sssd-baac15d2f47bcc0368d569804792d3eadca341f7.tar.xz
sssd-baac15d2f47bcc0368d569804792d3eadca341f7.zip
Update domain ID for local domain as well
Currently only the flat name of the configured domain is updated if it is not already set. This patch updates the domain ID as well. This is typically the case when trust support is enabled on the server side while sssd is running.
Diffstat (limited to 'src/responder/common/responder_get_domains.c')
-rw-r--r--src/responder/common/responder_get_domains.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index 468dd761b..c98c47b3b 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -329,7 +329,7 @@ process_subdomains(struct sss_domain_info *domain)
--c;
}
- if (domain->flat_name == NULL) {
+ if (domain->flat_name == NULL || domain->domain_id == NULL) {
ret = sysdb_master_domain_get_info(domain, domain->sysdb, &master_info);
if (ret != EOK) {
DEBUG(SSSDBG_FUNC_DATA, ("sysdb_master_domain_get_info " \
@@ -337,7 +337,19 @@ process_subdomains(struct sss_domain_info *domain)
goto done;
}
- domain->flat_name = talloc_strdup(domain, master_info->flat_name);
+ if (domain->flat_name == NULL) {
+ domain->flat_name = talloc_strdup(domain, master_info->flat_name);
+ if (domain->flat_name == NULL) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("talloc_strdup failed, ignoring"));
+ }
+ }
+
+ if (domain->domain_id == NULL) {
+ domain->domain_id = talloc_strdup(domain, master_info->id);
+ if (domain->domain_id == NULL) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("talloc_strdup failed, ignoring"));
+ }
+ }
talloc_free(master_info);
DEBUG(SSSDBG_TRACE_LIBS, ("Adding flat name [%s] to domain [%s].\n",
domain->flat_name, domain->name));