diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:41:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:41:13 +0930 |
commit | f7e84f8ef86c3323f70e2fa30fd8a49cab1febf9 (patch) | |
tree | 580a9c1302b332602263b7f1192ea5ee61d43521 /lib/tdb2/tdb1_check.c | |
parent | b4a5c6dcb6c60a32b92772396dadfffa6b721732 (diff) | |
download | samba-f7e84f8ef86c3323f70e2fa30fd8a49cab1febf9.tar.gz samba-f7e84f8ef86c3323f70e2fa30fd8a49cab1febf9.tar.bz2 samba-f7e84f8ef86c3323f70e2fa30fd8a49cab1febf9.zip |
tdb2: Make TDB1 use the same tdb_hash() wrapper as TDB2
This means converting the tdb1 inbuilt hash functions to the
tdb2-style, so they return 64 bit. We truncate to 32 bit everywhere
but in tdb_check() which needs to do so explicitly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 3e46dde21261966941469a6c75e1b45cd2d26324)
Diffstat (limited to 'lib/tdb2/tdb1_check.c')
-rw-r--r-- | lib/tdb2/tdb1_check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb2/tdb1_check.c b/lib/tdb2/tdb1_check.c index 51b8b594f4..edbfd86bcf 100644 --- a/lib/tdb2/tdb1_check.c +++ b/lib/tdb2/tdb1_check.c @@ -255,7 +255,7 @@ static bool tdb1_check_used_record(struct tdb1_context *tdb, if (!key.dptr) return false; - if (tdb->hash_fn(&key) != rec->full_hash) { + if ((uint32_t)tdb_hash(tdb, key.dptr, key.dsize) != rec->full_hash) { tdb->last_error = tdb_logerr(tdb, TDB_ERR_CORRUPT, TDB_LOG_ERROR, "Record offset %d has incorrect hash\n", off); goto fail_put_key; |