summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/domain_info_utils.c12
-rw-r--r--src/util/util.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index d0f709ec..c45c83d6 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -25,6 +25,7 @@
struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
struct sss_domain_info *parent,
const char *name,
+ const char *realm,
const char *flat_name,
const char *id)
{
@@ -55,6 +56,14 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
goto fail;
}
+ if (realm != NULL) {
+ dom->realm = talloc_strdup(dom, realm);
+ if (dom->realm == NULL) {
+ DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy realm name.\n"));
+ goto fail;
+ }
+ }
+
if (flat_name != NULL) {
dom->flat_name = talloc_strdup(dom, flat_name);
if (dom->flat_name == NULL) {
@@ -105,7 +114,8 @@ fail:
struct sss_domain_info *copy_subdomain(TALLOC_CTX *mem_ctx,
struct sss_domain_info *subdomain)
{
- return new_subdomain(mem_ctx, subdomain->parent, subdomain->name,
+ return new_subdomain(mem_ctx, subdomain->parent,
+ subdomain->name, subdomain->realm,
subdomain->flat_name, subdomain->domain_id);
}
diff --git a/src/util/util.h b/src/util/util.h
index df1ee3b0..a2b2a2d3 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -569,6 +569,7 @@ void to_sized_string(struct sized_string *out, const char *in);
struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
struct sss_domain_info *parent,
const char *name,
+ const char *realm,
const char *flat_name,
const char *id);
struct sss_domain_info *copy_subdomain(TALLOC_CTX *mem_ctx,