summaryrefslogtreecommitdiffstats
path: root/source/tdb
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-03-11 04:21:14 +0000
committerMartin Pool <mbp@samba.org>2003-03-11 04:21:14 +0000
commite412dd6d7e5a41de94c07c64b186390ccce104cc (patch)
tree57bd03d132364090accaecb1af0eeea72816f1b2 /source/tdb
parentc5c1a7979385778c08d6dd7796cfe8be1815992f (diff)
downloadsamba-e412dd6d7e5a41de94c07c64b186390ccce104cc.tar.gz
samba-e412dd6d7e5a41de94c07c64b186390ccce104cc.tar.xz
samba-e412dd6d7e5a41de94c07c64b186390ccce104cc.zip
When opening an existing DB, don't require the hash_size specified to
the open call to be the same as that of the existing tdb. The specified hash_size is only used if the tdb needs to be (re)created. With this patch in place, tdbtool can open the printing tdbs, which are created with a hash_size of 5000. Before it would fail with EIO.
Diffstat (limited to 'source/tdb')
-rw-r--r--source/tdb/tdb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index 097209ff7a9..0ec770ed81a 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -1728,8 +1728,7 @@ 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.hash_size != hash_size
+ || (tdb->header.version != TDB_VERSION
&& !(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) {