Blame SOURCES/0178-SYSDB_OPS-Mark-an-entry-as-expired-also-in-the-times.patch

ecf709
From 891e9c7cb924830334a42864ef2582e545f42723 Mon Sep 17 00:00:00 2001
ecf709
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
ecf709
Date: Mon, 29 May 2017 13:32:59 +0200
ecf709
Subject: [PATCH 178/181] SYSDB_OPS: Mark an entry as expired also in the
ecf709
 timestamp cache
ecf709
MIME-Version: 1.0
ecf709
Content-Type: text/plain; charset=UTF-8
ecf709
Content-Transfer-Encoding: 8bit
ecf709
ecf709
As the cleanup task will start using new methods for searching the users
ecf709
and groups which have to be cleaned up, SSSD starts relying more in a
ecf709
more consistent state of the timestamp cache on pretty much everything
ecf709
related to the cleanup task.
ecf709
ecf709
One of the things that would cause SSSD some problems is not having the
ecf709
ghost user expired in the persistent cache but not in the timestamp
ecf709
cache.
ecf709
ecf709
With this patch, the entry is also expired in the timestamp cache when
ecf709
it's present.
ecf709
ecf709
Related:
ecf709
https://pagure.io/SSSD/sssd/issue/3369
ecf709
ecf709
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
ecf709
ecf709
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
ecf709
(cherry picked from commit 9883d1e2913ff0c1db479f1ece8148e03155c7f3)
ecf709
---
ecf709
 src/db/sysdb_ops.c | 9 +++++++++
ecf709
 1 file changed, 9 insertions(+)
ecf709
ecf709
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
ecf709
index 12f8095d2edc60ffab09c92d64f968892c577bbf..ae26470487f859fe1de1dc364b6a05b9793a0545 100644
ecf709
--- a/src/db/sysdb_ops.c
ecf709
+++ b/src/db/sysdb_ops.c
ecf709
@@ -5065,6 +5065,15 @@ errno_t sysdb_mark_entry_as_expired_ldb_dn(struct sss_domain_info *dom,
ecf709
         goto done;
ecf709
     }
ecf709
 
ecf709
+    if (dom->sysdb->ldb_ts != NULL) {
ecf709
+        ret = ldb_modify(dom->sysdb->ldb_ts, msg);
ecf709
+        if (ret != LDB_SUCCESS) {
ecf709
+            DEBUG(SSSDBG_MINOR_FAILURE,
ecf709
+                  "Could not mark an entry as expired in the timestamp cache\n");
ecf709
+            /* non-fatal */
ecf709
+        }
ecf709
+    }
ecf709
+
ecf709
     ret = EOK;
ecf709
 
ecf709
 done:
ecf709
-- 
ecf709
2.9.4
ecf709