summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-13 13:23:31 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:46 +0100
commitb8dcd1216e5ea7065213c750a92dabfe01fa3b70 (patch)
tree4b16dcc47c1cf43846ea92106825c559ad2bf443 /src/util
parent2cbb879c517f2c756a2eb3962527979bac01ddab (diff)
downloadsssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.tar.gz
sssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.tar.xz
sssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.zip
Add realm info to sss_domain_info
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 d0f709ece..c45c83d64 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 df1ee3b08..a2b2a2d3e 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,