]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/check.c
tdb: enforce hashing, via example hash in old rwlocks entry in header.
[ccan] / ccan / tdb / check.c
index 49a21c1883afee5a138120a96551af434dc14c20..c741cef3316ee36d21a4b4b0926e697b5e8ba317 100644 (file)
@@ -39,7 +39,7 @@ static bool tdb_check_header(struct tdb_context *tdb, tdb_off_t *recovery)
        if (hdr.version != TDB_VERSION)
                goto corrupt;
 
-       if (hdr.rwlocks != 0)
+       if (hdr.hashcheck != hashcheck(tdb))
                goto corrupt;
 
        if (hdr.hash_size == 0)