summaryrefslogtreecommitdiffstats
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:57:29 +0100
commit32cc86be9c8325f45cef1b8f340e7cd888999f56 (patch)
treee1a2f93d1a6e611650c857100ee275429ac9ea72
parentcbae075573789e72890cfa0777b2e65193b410f6 (diff)
downloadsssd-32cc86be9c8325f45cef1b8f340e7cd888999f56.tar.gz
sssd-32cc86be9c8325f45cef1b8f340e7cd888999f56.tar.xz
sssd-32cc86be9c8325f45cef1b8f340e7cd888999f56.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.
-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));