Blame SOURCES/0010-krb5-Silence-an-error-message-if-no-cache-entries-ha.patch

841ac7
From 23fb7ea2f98c08a7df21b68bf96ddfe982fa284e Mon Sep 17 00:00:00 2001
841ac7
From: Jakub Hrozek <jhrozek@redhat.com>
841ac7
Date: Mon, 25 Mar 2019 10:17:39 +0100
841ac7
Subject: [PATCH] krb5: Silence an error message if no cache entries have
841ac7
 ccache stored but renewal is enabled
841ac7
841ac7
If no user entries had the ccacheFile attribute, the code would treat
841ac7
ENOENT as an error and print a CRIT-level debug message.
841ac7
841ac7
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
841ac7
(cherry picked from commit 22fc051df8bd1a9ec9e22aac85659d1da3bdbaec)
841ac7
---
841ac7
 src/providers/krb5/krb5_renew_tgt.c | 4 +++-
841ac7
 1 file changed, 3 insertions(+), 1 deletion(-)
841ac7
841ac7
diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c
841ac7
index c7e2bd91f..8b2159e92 100644
841ac7
--- a/src/providers/krb5/krb5_renew_tgt.c
841ac7
+++ b/src/providers/krb5/krb5_renew_tgt.c
841ac7
@@ -413,7 +413,9 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
841ac7
     ret = sysdb_search_entry(tmp_ctx, renew_tgt_ctx->be_ctx->domain->sysdb, base_dn,
841ac7
                              LDB_SCOPE_SUBTREE, ccache_filter, ccache_attrs,
841ac7
                              &msgs_count, &msgs);
841ac7
-    if (ret != EOK) {
841ac7
+    if (ret == ENOENT) {
841ac7
+        msgs_count = 0; /* Fall through */
841ac7
+    } else if (ret != EOK) {
841ac7
         DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_search_entry failed.\n");
841ac7
         goto done;
841ac7
     }
841ac7
-- 
841ac7
2.19.1
841ac7