diff options
author | Sumit Bose <sbose@redhat.com> | 2011-12-19 17:54:40 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-24 09:19:43 -0400 |
commit | 81165faf5d951aca69f410713730c26ff048ec44 (patch) | |
tree | 209eaea3251dc57c7038884e0926bd1663539f34 /src/providers/ipa/ipa_init.c | |
parent | fe1ac2443811a7125f2ddd0382a3f437f20377de (diff) | |
download | sssd-81165faf5d951aca69f410713730c26ff048ec44.tar.gz sssd-81165faf5d951aca69f410713730c26ff048ec44.tar.bz2 sssd-81165faf5d951aca69f410713730c26ff048ec44.zip |
IPA: Add get-domains target
Diffstat (limited to 'src/providers/ipa/ipa_init.c')
-rw-r--r-- | src/providers/ipa/ipa_init.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c index fca23f34..90acb108 100644 --- a/src/providers/ipa/ipa_init.c +++ b/src/providers/ipa/ipa_init.c @@ -37,6 +37,7 @@ #include "providers/ipa/ipa_dyndns.h" #include "providers/ipa/ipa_session.h" #include "providers/ldap/sdap_access.h" +#include "providers/ipa/ipa_subdomains.h" struct ipa_options *ipa_options = NULL; @@ -74,6 +75,11 @@ struct bet_ops ipa_hostid_ops = { }; #endif +struct bet_ops ipa_subdomains_ops = { + .handler = ipa_subdomains_handler, + .finalize = NULL +}; + int common_ipa_init(struct be_ctx *bectx) { const char *ipa_servers; @@ -513,3 +519,35 @@ int sssm_ipa_autofs_init(struct be_ctx *bectx, return EOK; #endif } + +int sssm_ipa_subdomains_init(struct be_ctx *bectx, + struct bet_ops **ops, + void **pvt_data) +{ + int ret; + struct ipa_subdomains_ctx *subdomains_ctx; + struct ipa_id_ctx *id_ctx; + + subdomains_ctx = talloc_zero(bectx, struct ipa_subdomains_ctx); + if (subdomains_ctx == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + return ENOMEM; + } + + ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + goto done; + } + subdomains_ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; + subdomains_ctx->search_bases = id_ctx->ipa_options->subdomains_search_bases; + + *ops = &ipa_subdomains_ops; + *pvt_data = subdomains_ctx; + +done: + if (ret != EOK) { + talloc_free(subdomains_ctx); + } + return ret; +} |