summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-03-11 04:41:22 +0000
committerMartin Pool <mbp@samba.org>2003-03-11 04:41:22 +0000
commitd606f8cb1eb69d897400c3a4f9c6813150d53c3a (patch)
tree5e8518c8b0e62811382953803f6d4f20fb00256e /source3/tdb
parent47247802125533e28740cc82657b972a3bdd17ca (diff)
downloadsamba-d606f8cb1eb69d897400c3a4f9c6813150d53c3a.tar.gz
samba-d606f8cb1eb69d897400c3a4f9c6813150d53c3a.tar.bz2
samba-d606f8cb1eb69d897400c3a4f9c6813150d53c3a.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. (This used to be commit 7090d9f6939b3c6334fba40b0741f8f899aba31a)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 097209ff7a..0ec770ed81 100644
--- a/source3/tdb/tdb.c
+++ b/source3/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) {