dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0081-IPA-Do-not-allow-the-AD-lookup-code-to-set-backend-a.patch

6cf099
From fbf7fe9a713948eaf5e47518c776f2ad664b9e46 Mon Sep 17 00:00:00 2001
6cf099
From: Jakub Hrozek <jhrozek@redhat.com>
6cf099
Date: Wed, 2 Sep 2015 13:41:26 +0200
6cf099
Subject: [PATCH 81/87] IPA: Do not allow the AD lookup code to set backend as
6cf099
 offline in server mode
6cf099
MIME-Version: 1.0
6cf099
Content-Type: text/plain; charset=UTF-8
6cf099
Content-Transfer-Encoding: 8bit
6cf099
6cf099
https://fedorahosted.org/sssd/ticket/2637
6cf099
6cf099
In server mode, we should not allow the AD lookups to set the backend
6cf099
offline. Rather just let them report an error and deal with the error
6cf099
separately.
6cf099
6cf099
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
6cf099
(cherry picked from commit 20162352030d1c577bb69d44e967d2c5839e5c0e)
6cf099
---
6cf099
 src/providers/ipa/ipa_subdomains_id.c | 8 +++++++-
6cf099
 1 file changed, 7 insertions(+), 1 deletion(-)
6cf099
6cf099
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
6cf099
index 610b1c58b3b180201cfb5b22f870f8937673e02e..ff14b4a4c68cb5c6e9865a66931ee4ecd6e49211 100644
6cf099
--- a/src/providers/ipa/ipa_subdomains_id.c
6cf099
+++ b/src/providers/ipa/ipa_subdomains_id.c
6cf099
@@ -633,6 +633,7 @@ ipa_get_ad_acct_send(TALLOC_CTX *mem_ctx,
6cf099
             ret = ENOMEM;
6cf099
             goto fail;
6cf099
         }
6cf099
+        clist[1]->ignore_mark_offline = true;
6cf099
         break;
6cf099
     default:
6cf099
         clist = talloc_zero_array(req, struct sdap_id_conn_ctx *, 2);
6cf099
@@ -641,6 +642,7 @@ ipa_get_ad_acct_send(TALLOC_CTX *mem_ctx,
6cf099
             goto fail;
6cf099
         }
6cf099
         clist[0] = ad_id_ctx->ldap_ctx;
6cf099
+        clist[0]->ignore_mark_offline = true;
6cf099
         clist[1] = NULL;
6cf099
     }
6cf099
 
6cf099
@@ -1036,7 +1038,11 @@ ipa_get_ad_acct_ad_part_done(struct tevent_req *subreq)
6cf099
 
6cf099
     ret = ad_handle_acct_info_recv(subreq, &state->dp_error, NULL);
6cf099
     talloc_zfree(subreq);
6cf099
-    if (ret != EOK) {
6cf099
+    if (ret == ERR_SUBDOM_INACTIVE) {
6cf099
+        be_mark_dom_offline(state->obj_dom, be_req_get_be_ctx(state->be_req));
6cf099
+        tevent_req_error(req, ret);
6cf099
+        return;
6cf099
+    } else if (ret != EOK) {
6cf099
         DEBUG(SSSDBG_OP_FAILURE, "AD lookup failed: %d\n", ret);
6cf099
         tevent_req_error(req, ret);
6cf099
         return;
6cf099
-- 
6cf099
2.4.3
6cf099