Blame SOURCES/0179-SYSDB_OPS-Invalidate-a-cache-entry-also-in-the-ts_ca.patch

ecf709
From 256e1b4162832570e10a85579d2b14ed7b54b7f2 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:29:26 +0200
ecf709
Subject: [PATCH 179/181] SYSDB_OPS: Invalidate a cache entry also in the
ecf709
 ts_cache
ecf709
MIME-Version: 1.0
ecf709
Content-Type: text/plain; charset=UTF-8
ecf709
Content-Transfer-Encoding: 8bit
ecf709
ecf709
Similarly to what has been in the previous commit (expiring an entry
ecf709
also in the timestamp cache), we should do the same when invalidating an
ecf709
entry.
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 a71f1a655dcc2ca6dc16bb8eb1c4c9e24cfe2c3e)
ecf709
---
ecf709
 src/db/sysdb_ops.c | 11 +++++++++++
ecf709
 1 file changed, 11 insertions(+)
ecf709
ecf709
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
ecf709
index ae26470487f859fe1de1dc364b6a05b9793a0545..ed936f0cb1a37155aabef96db1d267eb03ec0ed9 100644
ecf709
--- a/src/db/sysdb_ops.c
ecf709
+++ b/src/db/sysdb_ops.c
ecf709
@@ -5160,6 +5160,17 @@ int sysdb_invalidate_cache_entry(struct sss_domain_info *domain,
ecf709
         goto done;
ecf709
     }
ecf709
 
ecf709
+    if (sysdb->ldb_ts != NULL) {
ecf709
+        ret = sysdb_set_cache_entry_attr(sysdb->ldb_ts, entry_dn,
ecf709
+                                         attrs, SYSDB_MOD_REP);
ecf709
+        if (ret != EOK) {
ecf709
+            DEBUG(SSSDBG_MINOR_FAILURE,
ecf709
+                  "Cannot set attrs in the timestamp cache for %s, %d [%s]\n",
ecf709
+                  ldb_dn_get_linearized(entry_dn), ret, sss_strerror(ret));
ecf709
+            /* non-fatal */
ecf709
+        }
ecf709
+    }
ecf709
+
ecf709
     DEBUG(SSSDBG_FUNC_DATA,
ecf709
           "Cache entry [%s] has been invalidated.\n",
ecf709
           ldb_dn_get_linearized(entry_dn));
ecf709
-- 
ecf709
2.9.4
ecf709