URL: https://github.com/SSSD/sssd/pull/706
Author: jhrozek
 Title: #706: KCM: Fall back to using the first ccache if the default does not 
exist
Action: opened

PR body:
"""
Resolves: https://pagure.io/SSSD/sssd/issue/3838

KCM stores the default ccache in a separate DB entry. If the DB entry 
contains a UUID that cannot be found in the DB for whatever reason, we 
should just use the first ccache as the default. (This is what we already
do if there is no default)
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/706/head:pr706
git checkout pr706
From 6b41485c14be328eab02be7167e3875aecd1b0c9 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Fri, 28 Sep 2018 17:29:10 +0200
Subject: [PATCH] KCM: Fall back to using the first ccache if the default does
 not exist

Resolves:
https://pagure.io/SSSD/sssd/issue/3838

KCM stores the default ccache in a separate DB entry. If the DB entry
contains a UUID that cannot be found in the DB for whatever reason, we
should just use the first ccache as the default. (This is what we
already do if there is no default)
---
 src/responder/kcm/kcmsrv_ops.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/responder/kcm/kcmsrv_ops.c b/src/responder/kcm/kcmsrv_ops.c
index 1e229adc4..5c4ece79e 100644
--- a/src/responder/kcm/kcmsrv_ops.c
+++ b/src/responder/kcm/kcmsrv_ops.c
@@ -1509,7 +1509,17 @@ static void kcm_op_get_default_ccache_byuuid_done(struct tevent_req *subreq)
         DEBUG(SSSDBG_OP_FAILURE,
               "Cannot get ccahe by UUID [%d]: %s\n",
               ret, sss_strerror(ret));
-        tevent_req_error(req, ret);
+        /* Instead of failing the whole operation, return the first
+         * ccache as a fallback
+         */
+        subreq = kcm_ccdb_list_send(state, state->ev,
+                                    state->op_ctx->kcm_data->db,
+                                    state->op_ctx->client);
+        if (subreq == NULL) {
+            tevent_req_error(req, ENOMEM);
+            return;
+        }
+        tevent_req_set_callback(subreq, kcm_op_get_default_ccache_list_done, req);
         return;
     }
 
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to