Blame SOURCES/0002-KCM-Fall-back-to-using-the-first-ccache-if-the-defau.patch

5fca41
From 6c568c9126e950d56cee734934e455eb2f5a3659 Mon Sep 17 00:00:00 2001
5fca41
From: Jakub Hrozek <jhrozek@redhat.com>
5fca41
Date: Fri, 28 Sep 2018 17:29:10 +0200
5fca41
Subject: [PATCH] KCM: Fall back to using the first ccache if the default does
5fca41
 not exist
5fca41
MIME-Version: 1.0
5fca41
Content-Type: text/plain; charset=UTF-8
5fca41
Content-Transfer-Encoding: 8bit
5fca41
5fca41
Resolves:
5fca41
https://pagure.io/SSSD/sssd/issue/3838
5fca41
5fca41
KCM stores the default ccache in a separate DB entry. If the DB entry
5fca41
contains a UUID that cannot be found in the DB for whatever reason, we
5fca41
should just use the first ccache as the default. (This is what we
5fca41
already do if there is no default)
5fca41
5fca41
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
5fca41
(cherry picked from commit 6bf5bcad6b9c5fb5fd867cbb094fef2a02ebf22d)
5fca41
---
5fca41
 src/responder/kcm/kcmsrv_ops.c | 12 +++++++++++-
5fca41
 1 file changed, 11 insertions(+), 1 deletion(-)
5fca41
5fca41
diff --git a/src/responder/kcm/kcmsrv_ops.c b/src/responder/kcm/kcmsrv_ops.c
5fca41
index 1e229adc4..5c4ece79e 100644
5fca41
--- a/src/responder/kcm/kcmsrv_ops.c
5fca41
+++ b/src/responder/kcm/kcmsrv_ops.c
5fca41
@@ -1509,7 +1509,17 @@ static void kcm_op_get_default_ccache_byuuid_done(struct tevent_req *subreq)
5fca41
         DEBUG(SSSDBG_OP_FAILURE,
5fca41
               "Cannot get ccahe by UUID [%d]: %s\n",
5fca41
               ret, sss_strerror(ret));
5fca41
-        tevent_req_error(req, ret);
5fca41
+        /* Instead of failing the whole operation, return the first
5fca41
+         * ccache as a fallback
5fca41
+         */
5fca41
+        subreq = kcm_ccdb_list_send(state, state->ev,
5fca41
+                                    state->op_ctx->kcm_data->db,
5fca41
+                                    state->op_ctx->client);
5fca41
+        if (subreq == NULL) {
5fca41
+            tevent_req_error(req, ENOMEM);
5fca41
+            return;
5fca41
+        }
5fca41
+        tevent_req_set_callback(subreq, kcm_op_get_default_ccache_list_done, req);
5fca41
         return;
5fca41
     }
5fca41
 
5fca41
-- 
5fca41
2.19.1
5fca41