Blame SOURCES/0027-PAM-do-not-treat-error-for-cache-only-lookups-as-fat.patch

8aada9
From 100839b64390d7010bfa28552fd9381ef4366496 Mon Sep 17 00:00:00 2001
8aada9
From: Sumit Bose <sbose@redhat.com>
8aada9
Date: Fri, 26 Jun 2020 09:48:17 +0200
8aada9
Subject: [PATCH] PAM: do not treat error for cache-only lookups as fatal
8aada9
8aada9
The original fatal error came from a time where at this place in the
8aada9
code the response form the backend was checked and an error was clearly
8aada9
fatal.
8aada9
8aada9
Now we only check if the entry is in the cache and valid. An error would
8aada9
mean that the backend is called to lookup or refresh the entry. So the
8aada9
backend can change the state of the cache and make upcoming cache
8aada9
lookups successful. So it makes sense to not only call the backend if
8aada9
ENOENT is returned but for all kind of errors.
8aada9
8aada9
Resolves https://pagure.io/SSSD/sssd/issue/4098
8aada9
8aada9
Reviewed-by: Pawel Polawski <ppolawsk@redhat.com>
8aada9
---
8aada9
 src/responder/pam/pamsrv_cmd.c | 6 ++----
8aada9
 1 file changed, 2 insertions(+), 4 deletions(-)
8aada9
8aada9
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
8aada9
index 1cd901f15..666131cb7 100644
8aada9
--- a/src/responder/pam/pamsrv_cmd.c
8aada9
+++ b/src/responder/pam/pamsrv_cmd.c
8aada9
@@ -1941,10 +1941,8 @@ static void pam_check_user_search_next(struct tevent_req *req)
8aada9
     ret = cache_req_single_domain_recv(preq, req, &result);
8aada9
     talloc_zfree(req);
8aada9
     if (ret != EOK && ret != ENOENT) {
8aada9
-        DEBUG(SSSDBG_CRIT_FAILURE,
8aada9
-              "Fatal error, killing connection!\n");
8aada9
-        talloc_zfree(preq->cctx);
8aada9
-        return;
8aada9
+        DEBUG(SSSDBG_OP_FAILURE, "Cache lookup failed, trying to get fresh "
8aada9
+                                 "data from the backened.\n");
8aada9
     }
8aada9
 
8aada9
     DEBUG(SSSDBG_TRACE_ALL, "PAM initgroups scheme [%s].\n",
8aada9
-- 
8aada9
2.21.3
8aada9