URL: https://github.com/SSSD/sssd/pull/477
Author: fidencio
 Title: #477: SYSDB: Return EOK in case a non-fatal issue happened
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/477/head:pr477
git checkout pr477
From 99e37610ca545c4484c31dce1c150e9474ccf9e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fiden...@redhat.com>
Date: Thu, 14 Dec 2017 15:39:02 +0100
Subject: [PATCH] SYSDB: Return EOK in case a non-fatal issue happened
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There may be the case where we aren't able to merge the timestamps from
the fast ts db, which are treated as non-fatal issues. In case it
happens, let's return EOK instead of propagating the non-fatal error.

Signed-off-by: Fabiano FidĂȘncio <fiden...@redhat.com>
---
 src/db/sysdb_search.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index a6a81e23d..8e369dd6d 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -239,6 +239,7 @@ int sysdb_getpwnam(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Cannot merge timestamp cache values\n");
         /* non-fatal */
+        ret = EOK;
     }
 
     *_res = talloc_steal(mem_ctx, res);
@@ -351,6 +352,7 @@ int sysdb_getpwuid(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Cannot merge timestamp cache values\n");
         /* non-fatal */
+        ret = EOK;
     }
 
     *_res = talloc_steal(mem_ctx, res);
@@ -672,6 +674,7 @@ int sysdb_enumpwent_filter(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Cannot merge timestamp cache values\n");
         /* non-fatal */
+        ret = EOK;
     }
 
     res = sss_merge_ldb_results(res, ts_cache_res);
@@ -1188,6 +1191,7 @@ int sysdb_enumgrent_filter(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Cannot merge timestamp cache values\n");
         /* non-fatal */
+        ret = EOK;
     }
 
     res = sss_merge_ldb_results(res, ts_cache_res);
@@ -1591,6 +1595,7 @@ int sysdb_get_user_attr(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Cannot merge timestamp cache values\n");
         /* non-fatal */
+        ret = EOK;
     }
 
     *_res = talloc_steal(mem_ctx, res);
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to