Blob Blame History Raw
From 4897063996b624b71823e61c73916f47832f103a Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Tue, 29 Oct 2019 12:16:40 +0100
Subject: [PATCH 104/105] ipa: add failover to override lookups
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In the ipa_id_get_account_info request failover handling was missing.

Related to https://pagure.io/SSSD/sssd/issue/4114

Reviewed-by: Michal Židek <mzidek@redhat.com>
(cherry picked from commit b9a53cfca91c9db51b1e32ac2cb0965db3ccf05b)
---
 src/providers/ipa/ipa_id.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 94d5f9d90..9253514a3 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -640,7 +640,22 @@ static void ipa_id_get_account_info_got_override(struct tevent_req *subreq)
     ret = ipa_get_ad_override_recv(subreq, &dp_error, state,
                                    &state->override_attrs);
     talloc_zfree(subreq);
+
     if (ret != EOK) {
+        ret = sdap_id_op_done(state->op, ret, &dp_error);
+
+        if (dp_error == DP_ERR_OK && ret != EOK) {
+            /* retry */
+            subreq = sdap_id_op_connect_send(state->op, state, &ret);
+            if (subreq == NULL) {
+                DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed.\n");
+                goto fail;
+            }
+            tevent_req_set_callback(subreq, ipa_id_get_account_info_connected,
+                                    req);
+            return;
+        }
+
         DEBUG(SSSDBG_OP_FAILURE, "IPA override lookup failed: %d\n", ret);
         goto fail;
     }
-- 
2.20.1