From 0c174e4e7b6caa1111fbf4773acdfbbcf122489d Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Tue, 14 Nov 2023 15:16:53 +0100 Subject: [PATCH] config.h: fix incorrect defines for _wopen() This is a regression from commit 01341840 ("add basic CMake based build") S_IRUSR and S_IWUSR should NOT be defined as 0 but as _S_IREAD and _S_IWRITE, as it was already fixed in commit 077445d0 ("Fix some more wrong defines in config-msvc.h") Those are used as permission mode when opening a file. Passing zero makes file read-only, which break for example --status-file functionality. Github: fixes OpenVPN/openvpn#454 Trac: #1430 Change-Id: I53eaee85d7b284af6bc63da5f6d8f310ddd96c47 Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20231114141653.10486-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27393.html Signed-off-by: Gert Doering (cherry picked from commit 2fcfb77a8111cce9308bb893f52ecdb77de91e7c) --- config.h.cmake.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.h.cmake.in b/config.h.cmake.in index fddee753c57..29006ce7f76 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -469,8 +469,8 @@ typedef SSIZE_T ssize_t; #define strncasecmp strnicmp #define strcasecmp _stricmp -#define S_IRUSR 0 -#define S_IWUSR 0 +#define S_IRUSR _S_IREAD +#define S_IWUSR _S_IWRITE #define R_OK 4 #define W_OK 2 #define X_OK 1