From: Günther Deschner Date: Fri, 25 Jul 2025 20:50:08 +0000 (+0200) Subject: s3-winbindd: make sure we always have WINBINDD_CACHE_VERSION in winbindd_cache.tdb X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ee9b04f2c9875953fba60a26a764ef61670114;p=thirdparty%2Fsamba.git s3-winbindd: make sure we always have WINBINDD_CACHE_VERSION in winbindd_cache.tdb Guenther BUG: https://bugzilla.samba.org/show_bug.cgi?id=15963 Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Mon Dec 8 09:59:58 UTC 2025 on atb-devel-224 --- diff --git a/selftest/knownfail b/selftest/knownfail index 19955ec8ca3..ab2d79d7114 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -338,6 +338,3 @@ # We currently don't send referrals for LDAP modify of non-replicated attrs ^samba4.ldap.rodc.python\(rodc\).__main__.RodcTests.test_modify_nonreplicated.* - -# Currently winbindd_cache.tdb is not working as expected -^samba3.winbind_cache_sanity.WINBINDD_CACHE_VERSION.* diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index 4deb998f63c..3d908e4db08 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -3171,6 +3171,7 @@ static TDB_CONTEXT *wcache_open(void) { char *db_path; TDB_CONTEXT *tdb = NULL; + bool wcache_wiped = !lp_winbind_offline_logon(); db_path = wcache_path(); if (db_path == NULL) { @@ -3189,6 +3190,12 @@ static TDB_CONTEXT *wcache_open(void) 0600); TALLOC_FREE(db_path); + if (wcache_wiped) { + tdb_store_uint32(tdb, + WINBINDD_CACHE_VERSION_KEYSTR, + WINBINDD_CACHE_VERSION); + } + return tdb; }