]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Fix return value of tdb_fetch_uint32_byblob()
authorAndreas Schneider <asn@samba.org>
Tue, 11 May 2021 09:31:33 +0000 (11:31 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 12 May 2021 21:19:03 +0000 (21:19 +0000)
The initialize_winbindd_cache() function uses tdb_fetch_uint32_byblob()
to check if the cache version is valid and up to date. As
tdb_fetch_uint32_byblob() returns false for a successful fetch, we
always remove the winbind cache database. This breaks the winbind
offline logon feature.

This also affects other caches and pdb.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14702

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 12 21:19:03 UTC 2021 on sn-devel-184

lib/util/util_tdb.c
selftest/knownfail.d/offline_logon [deleted file]

index 70eeceff391c3e152ac4a789b59abac21f815c46..b00b5039ec19091a21e093f0b522dc4c8d3fe931 100644 (file)
@@ -203,7 +203,12 @@ static bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key,
                                    uint32_t *value)
 {
        int ret = tdb_parse_record(tdb, key, fetch_uint32_parser, value);
-       return ret;
+
+       if (ret == -1) {
+               return false;
+       }
+
+       return true;
 }
 
 /****************************************************************************
diff --git a/selftest/knownfail.d/offline_logon b/selftest/knownfail.d/offline_logon
deleted file mode 100644 (file)
index ec258de..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-samba.blackbox.offline_logon.wbinfo.pam_logon_alice\(ad_member_offline_logon\)
-samba.blackbox.offline_logon.wbinfo.pam_logon_bob\(ad_member_offline_logon\)
-samba.blackbox.offline_logon.wbinfo.kerberos_logon_alice\(ad_member_offline_logon\)
-samba.blackbox.offline_logon.wbinfo.kerberos_logon_bob\(ad_member_offline_logon\)