From 0716caac8bde5e3d7d19e80c7345096f94edad89 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 4 Feb 2003 23:40:17 +0000 Subject: Ensure we overwrite a tdb if the hash size changes. Jeremy. (This used to be commit 3497330ff53a264e433090066b7318c31d833411) --- source3/tdb/tdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index f309bdd315..c685d72b37 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -1709,7 +1709,8 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, if (read(tdb->fd, &tdb->header, sizeof(tdb->header)) != sizeof(tdb->header) || strcmp(tdb->header.magic_food, TDB_MAGIC_FOOD) != 0 - || (tdb->header.version != TDB_VERSION + || tdb->header.version != TDB_VERSION + || (tdb->header.hash_size != hash_size && !(rev = (tdb->header.version==TDB_BYTEREV(TDB_VERSION))))) { /* its not a valid database - possibly initialise it */ if (!(open_flags & O_CREAT) || tdb_new_database(tdb, hash_size) == -1) { -- cgit