Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
sssd.33610
0033-CACHE-Create-timestamp-if-missing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0033-CACHE-Create-timestamp-if-missing.patch of Package sssd.33610
From 0e6ea027aeadaaec8ad2117e2ef715063d98340f Mon Sep 17 00:00:00 2001 From: Tomas Halman <thalman@redhat.com> Date: Mon, 16 Nov 2020 17:28:19 +0100 Subject: [PATCH] CACHE: Create timestamp if missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases, object is stored in cache but the corresponding record in timestamp cache is missing (for example when timestamp cache file is deleted). The timestamp is never created in such case. With this patch we create new timestamp object if update doesn't work for this particular reason (missing object). Resolves: https://github.com/SSSD/sssd/issues/5121 Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 37761b42f570e9019f9dd850912a29385e80a14c) --- src/db/sysdb_ops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 1537abf02..7427c8b2e 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -1299,9 +1299,17 @@ int sysdb_set_entry_attr(struct sysdb_ctx *sysdb, if (ret == EOK && is_ts_ldb_dn(entry_dn)) { tret = sysdb_set_ts_entry_attr(sysdb, entry_dn, attrs, mod_op); + if (tret == ENOENT && mod_op == SYSDB_MOD_REP) { + /* Update failed because TS does non exist. Create missing TS */ + tret = sysdb_set_ts_entry_attr(sysdb, entry_dn, attrs, + SYSDB_MOD_ADD); + DEBUG(SSSDBG_TRACE_FUNC, + "The TS value for %s does not exist, trying to create it\n", + ldb_dn_get_linearized(entry_dn)); + } if (tret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - "Cannot set ts attrs for %s\n", ldb_dn_get_linearized(entry_dn)); + "Cannot set TS attrs for %s\n", ldb_dn_get_linearized(entry_dn)); /* Not fatal */ } else { state_mask |= SSS_SYSDB_TS_CACHE; -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor