summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa/ipa_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ipa/ipa_init.c')
-rw-r--r--src/providers/ipa/ipa_init.c38
1 files changed, 38 insertions, 0 deletions
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;
+}