Skip to contentSkip to conversation

Fix a couple of issues in openvpn_execve()

PATCH In review David Sommerseth 3 participants 3 messages Jan 9, 2012 – Jan 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a couple of issues in openvpn_execve()

If openvpn_execve() is not able to fork(), it would make any noise about it. So this patch adds a log notification if this happens.

In addition, if openvpn_execve() is called with an empty argv array, it should exit instantly. This is not expected to happen at all and might indicate a much more serious issue (or programming error) somewhere else in the code. Thus, abort execution to get these issues flushed out as quickly as possible.

---
 misc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
misc.c +2 -2
index 9ac2877..b834a3e 100644
@@ -529,7 +529,7 @@ openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned i
 		  exit (127);
 		}
 	      else if (pid < (pid_t)0) /* fork failed */
-		;
+		msg (M_ERR, "openvpn_execve: unable to fork");
 	      else /* parent side */
 		{
 		  if (waitpid (pid, &ret, 0) != pid)
@@ -556,7 +556,7 @@ openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned i
     }
   else
     {
-      msg (M_WARN, "openvpn_execve: called with empty argv");
+      msg (M_FATAL, "openvpn_execve: called with empty argv");
     }
 
   gc_free (&gc);
Signature · 1 line
1.7.4.4
#1 lore raw

Hi,

Quoted 8 lines · David Sommerseth

If openvpn_execve() is not able to fork(), it would make any noise about it. So this patch adds a log notification if this happens.

In addition, if openvpn_execve() is called with an empty argv array, it should exit instantly. This is not expected to happen at all and might indicate a much more serious issue (or programming error) somewhere else in the code. Thus, abort execution to get these issues flushed out as quickly as possible.

ACK.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 12 lines · David Sommerseth

If openvpn_execve() is not able to fork(), it would make any noise about it. So this patch adds a log notification if this happens.

In addition, if openvpn_execve() is called with an empty argv array, it should exit instantly. This is not expected to happen at all and might indicate a much more serious issue (or programming error) somewhere else in the code. Thus, abort execution to get these issues flushed out as quickly as possible.

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

Applied to master branch in -testing and -stable.

commit 8ee5646111625c598efbc82413649b1ab6275877

    Signed-off-by: David Sommerseth <[email protected]...>
    Acked-by: Gert Doering <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8MYvAACgkQDC186MBRfrpbtwCeIo9lIFjRaAWXL9NM7yIBaD4V +1YAoKZ+SdjP2vHRX+lq3i8G5Rg4UuhW
=+Oq1
-----END PGP SIGNATURE-----