From b8dcd1216e5ea7065213c750a92dabfe01fa3b70 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 13 Jan 2013 13:23:31 -0500 Subject: Add realm info to sss_domain_info --- src/util/domain_info_utils.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/util/domain_info_utils.c') 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); } -- cgit