>From 616577f8df1c8f6c2d168f0a6de75962598a20b6 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 2 Sep 2015 13:41:26 +0200 Subject: [PATCH 4/4] IPA: Do not allow the AD lookup code to set backend as offline in server mode https://fedorahosted.org/sssd/ticket/2637 In server mode, we should not allow the AD lookups to set the backend offline. Rather just let them report an error and deal with the error separately. --- src/providers/ipa/ipa_subdomains_id.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c index ad1743ae5fe7ff80518e7bc58e4df04143732719..7c609ab6e69d6f23c4de7c1c9569d73074d4e2dd 100644 --- a/src/providers/ipa/ipa_subdomains_id.c +++ b/src/providers/ipa/ipa_subdomains_id.c @@ -634,6 +634,7 @@ ipa_get_ad_acct_send(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto fail; } + clist[1]->ignore_mark_offline = true; break; default: clist = talloc_zero_array(req, struct sdap_id_conn_ctx *, 2); @@ -642,6 +643,7 @@ ipa_get_ad_acct_send(TALLOC_CTX *mem_ctx, goto fail; } clist[0] = ad_id_ctx->ldap_ctx; + clist[0]->ignore_mark_offline = true; clist[1] = NULL; } @@ -1037,7 +1039,11 @@ ipa_get_ad_acct_ad_part_done(struct tevent_req *subreq) ret = ad_handle_acct_info_recv(subreq, &state->dp_error, NULL); talloc_zfree(subreq); - if (ret != EOK) { + if (ret == ERR_SUBDOM_INACTIVE) { + be_mark_dom_offline(state->obj_dom, be_req_get_be_ctx(state->be_req)); + tevent_req_error(req, ret); + return; + } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, "AD lookup failed: %d\n", ret); tevent_req_error(req, ret); return; -- 2.4.3