diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-13 13:23:31 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-02-10 22:08:46 +0100 |
commit | b8dcd1216e5ea7065213c750a92dabfe01fa3b70 (patch) | |
tree | 4b16dcc47c1cf43846ea92106825c559ad2bf443 /src/util/domain_info_utils.c | |
parent | 2cbb879c517f2c756a2eb3962527979bac01ddab (diff) | |
download | sssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.tar.gz sssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.tar.xz sssd-b8dcd1216e5ea7065213c750a92dabfe01fa3b70.zip |
Add realm info to sss_domain_info
Diffstat (limited to 'src/util/domain_info_utils.c')
-rw-r--r-- | src/util/domain_info_utils.c | 12 |
1 files changed, 11 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); } |