diff options
Diffstat (limited to 'src/providers/ipa/ipa_init.c')
-rw-r--r-- | src/providers/ipa/ipa_init.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c index b3544f74..0484200c 100644 --- a/src/providers/ipa/ipa_init.c +++ b/src/providers/ipa/ipa_init.c @@ -34,6 +34,7 @@ #include "providers/ipa/ipa_auth.h" #include "providers/ipa/ipa_access.h" #include "providers/ipa/ipa_dyndns.h" +#include "providers/ipa/ipa_session.h" struct ipa_options *ipa_options = NULL; @@ -59,6 +60,11 @@ struct bet_ops ipa_access_ops = { .finalize = NULL }; +struct bet_ops ipa_session_ops = { + .handler = ipa_session_handler, + .finalize = NULL +}; + int common_ipa_init(struct be_ctx *bectx) { const char *ipa_servers; @@ -393,3 +399,39 @@ done: } return ret; } + +int sssm_ipa_session_init(struct be_ctx *bectx, + struct bet_ops **ops, + void **pvt_data) +{ + int ret; + struct ipa_session_ctx *session_ctx; + struct ipa_options *opts; + + session_ctx = talloc_zero(bectx, struct ipa_session_ctx); + if (session_ctx == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + return ENOMEM; + } + + ret = sssm_ipa_id_init(bectx, ops, (void **) &session_ctx->id_ctx); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + goto done; + } + + opts = session_ctx->id_ctx->ipa_options; + + session_ctx->hbac_search_bases = opts->hbac_search_bases; + session_ctx->host_search_bases = opts->host_search_bases; + session_ctx->selinux_search_bases = opts->selinux_search_bases; + + *ops = &ipa_session_ops; + *pvt_data = session_ctx; + +done: + if (ret != EOK) { + talloc_free(session_ctx); + } + return ret; +} |