]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9385 fix using MDB_NOSUBDIR with nonexistent file
authorKris Zyp <kriszyp@gmail.com>
Mon, 2 Nov 2020 20:33:09 +0000 (20:33 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 13 May 2022 16:16:29 +0000 (17:16 +0100)
libraries/liblmdb/mdb.c

index 72c4c437ffc2076e3bfdffd1ee90a83e3a127b1a..befc70bc7353d0316f88ecc79018276d87054b41 100644 (file)
@@ -5995,11 +5995,8 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode
 #ifndef _WIN32
        {
                struct stat st;
-               rc = stat(path, &st);
-               if (rc)
-                       return ErrCode();
                flags &= ~MDB_RAWPART;
-               if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))
+               if (!stat(path, &st) && (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode)))
                        flags |= MDB_RAWPART | MDB_NOSUBDIR;
        }
 #endif