summaryrefslogtreecommitdiff
path: root/src/providers/ad
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ad')
-rw-r--r--src/providers/ad/ad_init.c47
-rw-r--r--src/providers/ad/ad_subdomains.c2
2 files changed, 22 insertions, 27 deletions
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
index d5488ad0..aada14ec 100644
--- a/src/providers/ad/ad_init.c
+++ b/src/providers/ad/ad_init.c
@@ -135,29 +135,36 @@ sssm_ad_id_init(struct be_ctx *bectx,
ad_ctx->ad_options = ad_options;
ad_options->id_ctx = ad_ctx;
- sdap_ctx = talloc_zero(ad_options, struct sdap_id_ctx);
- if (!sdap_ctx) {
+ sdap_ctx = sdap_id_ctx_new(ad_options, bectx, ad_options->service->sdap);
+ if (sdap_ctx == NULL) {
return ENOMEM;
}
- sdap_ctx->be = bectx;
- sdap_ctx->service = ad_options->service->sdap;
ad_ctx->sdap_id_ctx = sdap_ctx;
- ret = ad_get_id_options(ad_options, bectx->cdb,
- bectx->conf_path,
- &sdap_ctx->opts);
+ ret = ad_dyndns_init(sdap_ctx->be, ad_options);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ ("Failure setting up automatic DNS update\n"));
+ /* Continue without DNS updates */
+ }
+
+ ret = sdap_id_setup_tasks(sdap_ctx);
if (ret != EOK) {
goto done;
}
- ret = setup_tls_config(sdap_ctx->opts->basic);
+ ret = sdap_setup_child();
if (ret != EOK) {
- DEBUG(SSSDBG_CRIT_FAILURE,
- ("setup_tls_config failed [%s]\n", strerror(ret)));
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ ("setup_child failed [%d][%s].\n",
+ ret, strerror(ret)));
goto done;
}
- ret = sdap_id_conn_cache_create(sdap_ctx, sdap_ctx, &sdap_ctx->conn_cache);
+ /* Set up various SDAP options */
+ ret = ad_get_id_options(ad_options, bectx->cdb,
+ bectx->conf_path,
+ &sdap_ctx->opts);
if (ret != EOK) {
goto done;
}
@@ -166,23 +173,11 @@ sssm_ad_id_init(struct be_ctx *bectx,
ret = sdap_idmap_init(sdap_ctx, sdap_ctx, &sdap_ctx->opts->idmap_ctx);
if (ret != EOK) goto done;
- ret = ad_dyndns_init(sdap_ctx->be, ad_options);
- if (ret != EOK) {
- DEBUG(SSSDBG_MINOR_FAILURE,
- ("Failure setting up automatic DNS update\n"));
- /* Continue without DNS updates */
- }
- ret = sdap_id_setup_tasks(sdap_ctx);
- if (ret != EOK) {
- goto done;
- }
-
- ret = sdap_setup_child();
+ ret = setup_tls_config(sdap_ctx->opts->basic);
if (ret != EOK) {
- DEBUG(SSSDBG_FATAL_FAILURE,
- ("setup_child failed [%d][%s].\n",
- ret, strerror(ret)));
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("setup_tls_config failed [%s]\n", strerror(ret)));
goto done;
}
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index 51c69554..da0c85e7 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -93,7 +93,7 @@ static void ad_subdomains_retrieve(struct ad_subdomains_ctx *ctx,
req_ctx->reply = NULL;
req_ctx->sdap_op = sdap_id_op_create(req_ctx,
- ctx->sdap_id_ctx->conn_cache);
+ ctx->sdap_id_ctx->conn->conn_cache);
if (req_ctx->sdap_op == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n"));
ret = ENOMEM;