summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;