Skip to contentSkip to conversation

Declare Windows version of openvpn_execve() before use

PATCH In review [email protected]... 2 participants 2 messages Oct 25, 2018 – Oct 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Declare Windows version of openvpn_execve() before use

From: Selva Nair <[email protected]...>

commit bf97c00f7dba441b504881f38e40afcbb610a39f moved the generic openvpn_execve() to run_command.c and made it static. But the Windows version is still in win32.c and is called from run_command.c

Fix by declaring the function in win32.h

---
This is an easy way out. In the spirit of commit bf97c00f7db, the entire win32 version of openvpn_execve() could move to run_command.c and become static. That will also require pulling wide_cmd_line() and env_block() out of win32.c.

 src/openvpn/win32.h | 7 +++++++
 1 file changed, 7 insertions(+)
src/openvpn/win32.h +7 -0
index b5cbe25..4b4524f 100644
@@ -27,6 +27,7 @@
 
 #include "mtu.h"
 #include "openvpn-msg.h"
+#include "argv.h"
 
 /* location of executables */
 #define SYS_PATH_ENV_VAR_NAME "SystemRoot"  /* environmental variable name that normally contains the system path */
@@ -316,5 +317,11 @@ const char *win32_version_string(struct gc_arena *gc, bool add_name);
 bool send_msg_iservice(HANDLE pipe, const void *data, size_t size,
                        ack_message_t *ack, const char *context);
 
+/*
+ * Attempt to simulate fork/execve on Windows
+ */
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags);
+
 #endif /* ifndef OPENVPN_WIN32_H */
 #endif /* ifdef _WIN32 */
Signature · 1 line
2.6.2
Acked-by on v1 1/1
#1 lore raw

"taking the quick fix for now". Test built on mingw/ubuntu 16.04.

Your patch has been applied to the master branch.

commit 253f015558d3ce3c74a4806748c8d4fcab96fb5e

Author: Selva Nair
Date:   Wed Oct 24 23:05:16 2018 -0400
     Declare Windows version of openvpn_execve() before use

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

--
kind regards,

Gert Doering