From 61b1bd1dca145a0417907793579352c66b016c23 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:34:13 +0930 Subject: 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 (Imported from CCAN commit 3004f7e89a5978064b4fb29c1027e6d0d39e9418) --- lib/tdb2/test/run-tdb1-oldhash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/tdb2/test/run-tdb1-oldhash.c') diff --git a/lib/tdb2/test/run-tdb1-oldhash.c b/lib/tdb2/test/run-tdb1-oldhash.c index 32b4200d54..4f74dbb95b 100644 --- a/lib/tdb2/test/run-tdb1-oldhash.c +++ b/lib/tdb2/test/run-tdb1-oldhash.c @@ -25,13 +25,13 @@ int main(int argc, char *argv[]) tdb1_close(tdb); tdb = tdb1_open_ex("test/old-nohash-le.tdb1", 0, 0, O_RDWR, 0, - &taplogctx, tdb1_jenkins_hash); + &taplogctx, tdb1_incompatible_hash); ok1(tdb); ok1(tdb1_check(tdb, NULL, NULL) == 0); tdb1_close(tdb); tdb = tdb1_open_ex("test/old-nohash-be.tdb1", 0, 0, O_RDWR, 0, - &taplogctx, tdb1_jenkins_hash); + &taplogctx, tdb1_incompatible_hash); ok1(tdb); ok1(tdb1_check(tdb, NULL, NULL) == 0); tdb1_close(tdb); -- cgit