summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb1_hash.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:34:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:34:13 +0930
commit61b1bd1dca145a0417907793579352c66b016c23 (patch)
tree913e709da52d81b38afb6f91e917e5e25db3f451 /lib/tdb2/tdb1_hash.c
parentebb3017cf08cc4dad3217db6cea404069b494b47 (diff)
downloadsamba-61b1bd1dca145a0417907793579352c66b016c23.tar.gz
samba-61b1bd1dca145a0417907793579352c66b016c23.tar.bz2
samba-61b1bd1dca145a0417907793579352c66b016c23.zip
tdb2: approximate INCOMPATIBLE_HASH flag with tdb1_incompatible_hash()
Rather than leak TDB_INCOMPATIBLE_HASH through to the TDB2 API, we make it that if they use the tdb1_incompatible_hash function as their hash, then we treat it as if they had specified the TDB_INCOMPATIBLE_HASH flag (ie. we mark the header so it's unusable by tdb < 1.2.6). This precludes the possibility of using TDB_INCOMPATIBLE_HASH with a custom hash function: that used to allow the user to ensure that old TDB versions couldn't open the TDB file (and recent ones check the header to ensure they're using the right hash). But that's a small loss. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 3004f7e89a5978064b4fb29c1027e6d0d39e9418)
Diffstat (limited to 'lib/tdb2/tdb1_hash.c')
-rw-r--r--lib/tdb2/tdb1_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb2/tdb1_hash.c b/lib/tdb2/tdb1_hash.c
index 50e49505ca..886577da70 100644
--- a/lib/tdb2/tdb1_hash.c
+++ b/lib/tdb2/tdb1_hash.c
@@ -339,7 +339,7 @@ static uint32_t hashlittle( const void *key, size_t length )
return c;
}
-unsigned int tdb1_jenkins_hash(TDB_DATA *key)
+unsigned int tdb1_incompatible_hash(TDB_DATA *key)
{
return hashlittle(key->dptr, key->dsize);
}