From 81165faf5d951aca69f410713730c26ff048ec44 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 19 Dec 2011 17:54:40 +0100 Subject: IPA: Add get-domains target --- src/providers/ipa/ipa_init.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/providers/ipa/ipa_init.c') diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c index fca23f349..90acb1082 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; +} -- cgit