From 4bcc1eef091fb26c342fa82ccc45cd912c112278 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 12 Sep 2019 21:40:59 +0300 Subject: [PATCH] mdbx: disallow multi-opening without MDBX_DBG_LEGACY_MULTIOPEN. Change-Id: I0e11d686954bd8c89dac9a46b4c5e17bc0dd6419 --- src/elements/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/elements/core.c b/src/elements/core.c index 23b14f3e..5f15adf5 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -6747,7 +6747,9 @@ static int __cold mdbx_setup_lck(MDBX_env *env, char *lck_pathname, err = uniq_check(&env->me_lck_mmap, &inprocess_neighbor); if (MDBX_IS_ERROR(err)) goto bailout; - if (inprocess_neighbor && (inprocess_neighbor->me_flags & MDBX_EXCLUSIVE)) { + if (inprocess_neighbor && + ((mdbx_runtime_flags & MDBX_DBG_LEGACY_MULTIOPEN) == 0 || + (inprocess_neighbor->me_flags & MDBX_EXCLUSIVE) != 0)) { err = MDBX_BUSY; goto bailout; }