From: Rusty Russell Date: Sun, 29 Jan 2012 23:36:55 +0000 (+1030) Subject: tdb_compat: only use hashsize attribute when O_CREAT X-Git-Tag: tevent-0.9.15~154 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd1d57370d6d83473a7ada3ceb8d250d357ff429;p=thirdparty%2Fsamba.git tdb_compat: only use hashsize attribute when O_CREAT tdb2 complains if you specify a tdb1 hashsize, and you're not actually trying to create a new database. Signed-off-by: Rusty Russell --- diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c index b37e6cc7ba0..0406eff55e4 100644 --- a/lib/tdb_compat/tdb_compat.c +++ b/lib/tdb_compat/tdb_compat.c @@ -136,7 +136,7 @@ tdb_open_compat_(const char *name, int hash_size, tdb_flags &= ~TDB_VOLATILE; } - if (hash_size && (tdb_flags & TDB_VERSION1)) { + if (hash_size && (tdb_flags & TDB_VERSION1) && (open_flags & O_CREAT)) { hsize.base.attr = TDB_ATTRIBUTE_TDB1_HASHSIZE; hsize.base.next = attr; hsize.tdb1_hashsize.hsize = hash_size;