dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From 02c15d40efe6dd9107528469904f1315fca37416 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Thu, 3 Jan 2019 15:07:59 +0100
Subject: [PATCH 87/88] KCM: Deleting a non-existent ccache should not yield an
 error

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

When the KCM destroy operation is called, it receives a name as an input. If
the name cannot be found, we would currently return KRB5_CC_NOTFOUND. But
other ccache types return KRB5_FCC_NOFILE in that case and e.g. utilities
like kdestroy special case KRB5_FCC_NOFILE to be non-fatal.

Reviewed-by: Tomas Halman <thalman@redhat.com>
---
 src/responder/kcm/kcmsrv_ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/responder/kcm/kcmsrv_ops.c b/src/responder/kcm/kcmsrv_ops.c
index 1e229adc4..9352909f4 100644
--- a/src/responder/kcm/kcmsrv_ops.c
+++ b/src/responder/kcm/kcmsrv_ops.c
@@ -698,9 +698,10 @@ static void kcm_op_destroy_getbyname_done(struct tevent_req *subreq)
     ret = kcm_ccdb_uuid_by_name_recv(subreq, state, uuid);
     talloc_zfree(subreq);
     if (ret != EOK) {
-        DEBUG(SSSDBG_OP_FAILURE,
+        DEBUG(SSSDBG_MINOR_FAILURE,
               "Cannot get matching ccache [%d]: %s\n",
               ret, sss_strerror(ret));
+        ret = ERR_NO_MATCHING_CREDS;
         tevent_req_error(req, ret);
         return;
     }
-- 
2.19.1