summaryrefslogtreecommitdiff
path: root/lib/tdb_compat
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-01-30 10:06:55 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-01-30 10:06:55 +1030
commitdd1d57370d6d83473a7ada3ceb8d250d357ff429 (patch)
treea4f36a35bd0b1c0a5e1f9f271741b175f8e0d35c /lib/tdb_compat
parentae62d46a9fcfee9db177ddb3d0f1f2c28c889a35 (diff)
downloadsamba-dd1d57370d6d83473a7ada3ceb8d250d357ff429.tar.gz
samba-dd1d57370d6d83473a7ada3ceb8d250d357ff429.tar.bz2
samba-dd1d57370d6d83473a7ada3ceb8d250d357ff429.zip
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb_compat')
-rw-r--r--lib/tdb_compat/tdb_compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c
index b37e6cc7ba..0406eff55e 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;