summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2014-09-24 13:03:53 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-10-20 16:14:54 +0200
commitc9589c42bcdcc864c6becda3e6c04b890ee81b0c (patch)
treebf45809ec8e1bb66bedf44acd5fb031b9ab9e75f /src/util
parente7cc651468ab8b1462a6a39e712e7b8d36a3a166 (diff)
downloadsssd-c9589c42bcdcc864c6becda3e6c04b890ee81b0c.tar.gz
sssd-c9589c42bcdcc864c6becda3e6c04b890ee81b0c.tar.xz
sssd-c9589c42bcdcc864c6becda3e6c04b890ee81b0c.zip
new_subdomain: copy view data from parent
Since a view applies to the whole domain-subdomain tree the view data is copied from the parent the new created domains. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/domain_info_utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index 8ffbec2f3..4e2c14c94 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -220,6 +220,17 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
}
dom->parent = parent;
+
+ /* Sub-domains always have the same view as the parent */
+ dom->has_views = parent->has_views;
+ if (parent->view_name != NULL) {
+ dom->view_name = talloc_strdup(dom, parent->view_name);
+ if (dom->view_name == NULL) {
+ DEBUG(SSSDBG_OP_FAILURE, "Failed to copy parent's view name.\n");
+ goto fail;
+ }
+ }
+
dom->name = talloc_strdup(dom, name);
if (dom->name == NULL) {
DEBUG(SSSDBG_OP_FAILURE, "Failed to copy domain name.\n");