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

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