+uint32_t hashcheck(struct tdb_context *tdb)
+{
+ uint32_t vals[] = { TDB_VERSION, TDB_MAGIC };
+ TDB_DATA hashkey = { (unsigned char *)vals, sizeof(vals) };
+
+ /* If we're using the default hash, let old code still open the db. */
+ if (tdb->hash_fn == default_tdb_hash)
+ return 0;
+
+ /* Only let new hash-aware TDB code open it (must not be zero!) */
+ return (tdb->hash_fn(&hashkey) | 1);
+}