mdbx: проверка pid только для запроса активной env (backport).

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-11-11 20:07:21 +03:00
parent 5abb6a9bbf
commit 6e4473777e

View File

@ -8258,17 +8258,16 @@ static __inline int check_env(const MDBX_env *env, const bool wanna_active) {
if (unlikely(env->me_signature.weak != MDBX_ME_SIGNATURE))
return MDBX_EBADSIGN;
#if MDBX_ENV_CHECKPID
if (unlikely(env->me_pid != osal_getpid())) {
((MDBX_env *)env)->me_flags |= MDBX_FATAL_ERROR;
return MDBX_PANIC;
}
#endif /* MDBX_ENV_CHECKPID */
if (unlikely(env->me_flags & MDBX_FATAL_ERROR))
return MDBX_PANIC;
if (wanna_active) {
#if MDBX_ENV_CHECKPID
if (unlikely(env->me_pid != osal_getpid())) {
((MDBX_env *)env)->me_flags |= MDBX_FATAL_ERROR;
return MDBX_PANIC;
}
#endif /* MDBX_ENV_CHECKPID */
if (unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0))
return MDBX_EPERM;
eASSERT(env, env->me_map != nullptr);