diff options
author | David Sommerseth <davids@redhat.com> | 2012-01-09 18:07:28 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-01-10 14:22:10 +0100 |
commit | 8ee5646111625c598efbc82413649b1ab6275877 (patch) | |
tree | eaabf0f562425b5b1785c523a8cc7f9dc8467c84 | |
parent | 9449e6a9eba30c9ed054f57d630a88c9f087080f (diff) | |
download | openvpn-8ee5646111625c598efbc82413649b1ab6275877.tar.gz openvpn-8ee5646111625c598efbc82413649b1ab6275877.tar.xz openvpn-8ee5646111625c598efbc82413649b1ab6275877.zip |
Fix a couple of issues in openvpn_execve()
If openvpn_execve() is not able to fork(), it would not 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.
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r-- | misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |