Skip to contentSkip to conversation

Change in openvpn[master]: config.h: fix incorrect defines for _wopen()

Openvpn-devel In review stipa (Code Review) 2 participants 6 messages Nov 14, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1699964322000.I53eaee85d7b284af6bc63da5f6d8f310ddd96c47@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/429?usp=email

to review the following change.

Change subject: config.h: fix incorrect defines for _wopen()
......................................................................

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.

Fixes https://github.com/OpenVPN/openvpn/issues/454

Change-Id I53eaee85d7b284af6bc63da5f6d8f310ddd96c47

---
M config.h.cmake.in

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/429/1

config.h.cmake.in +2 -2
index f2cdd39..1c0dd6f 100644
@@ -469,8 +469,8 @@
 #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

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/429?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I53eaee85d7b284af6bc63da5f6d8f310ddd96c47
Gerrit-Change-Number: 429
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos, stipa.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/429?usp=email )

Change subject: config.h: fix incorrect defines for _wopen()
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/429?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I53eaee85d7b284af6bc63da5f6d8f310ddd96c47
Gerrit-Change-Number: 429
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 14 Nov 2023 14:13:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 config.h: fix incorrect defines for _wopen()

In reply to a message not in the archive

From: Lev Stipakov <[email protected]...>

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

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/429
This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

config.h.cmake.in +2 -2
index f2cdd39..1c0dd6f 100644
@@ -469,8 +469,8 @@
 #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
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: config.h: fix incorrect defines for _wopen()

I've not actually tested it, but since we had to fix this once before, it's "obviously correct". Also Lev understands Windows :-)

Your patch has been applied to the master and release/2.6 branch.

commit 2fcfb77a8111cce9308bb893f52ecdb77de91e7c (master) commit 0c174e4e7b6caa1111fbf4773acdfbbcf122489d (release/2.6)

Author: Lev Stipakov
Date:   Tue Nov 14 15:16:53 2023 +0100
     config.h: fix incorrect defines for _wopen()

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg27393.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/429?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: config.h: fix incorrect defines for _wopen()
......................................................................

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

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27393.html

---
M config.h.cmake.in

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/429/2

config.h.cmake.in +2 -2
index f2cdd39..1c0dd6f 100644
@@ -469,8 +469,8 @@
 #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

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/429?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I53eaee85d7b284af6bc63da5f6d8f310ddd96c47
Gerrit-Change-Number: 429
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/429?usp=email )

Change subject: config.h: fix incorrect defines for _wopen()
......................................................................

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

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27393.html

---
M config.h.cmake.in

1 file changed, 2 insertions(+), 2 deletions(-)
config.h.cmake.in +2 -2
index f2cdd39..1c0dd6f 100644
@@ -469,8 +469,8 @@
 #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

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/429?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I53eaee85d7b284af6bc63da5f6d8f310ddd96c47
Gerrit-Change-Number: 429
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged