Skip to content

Commit

Permalink
config.h: fix incorrect defines for _wopen()
Browse files Browse the repository at this point in the history
This is a regression from commit

  0134184 ("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

  077445d ("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 <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
  • Loading branch information
lstipakov authored and cron2 committed Nov 14, 2023
1 parent 20c42b8 commit 2fcfb77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fcfb77

Please sign in to comment.