]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Better error message when script fails due to script-security setting
authorSelva Nair <selva.nair@gmail.com>
Thu, 21 Feb 2019 00:46:22 +0000 (19:46 -0500)
committerGert Doering <gert@greenie.muc.de>
Thu, 28 Feb 2019 17:02:28 +0000 (18:02 +0100)
commit01a3c876d4911ff7ea82b04edeb43defdebc69d7
tree15876ac74f562a70b3517080bf6ec9ffe3cdf8af
parent57ec6cec85b92e6af35a7871d105d84a753d6549
Better error message when script fails due to script-security setting

- Add a new return value (-2) for openvpn_execve() when external
  program execution is not allowed due to a low script-security
  setting.

- Add a corresponding error message

Errors and warnings in such cases will now display as
"WARNING: failed running command (<cmd>) :" followed by

"disallowed by script-security setting" on all platforms

instead of the current

"external program did not execute -- returned error code -1"
on Windows and
"external program fork failed" on other platforms.

The error is FATAL for some scripts and that behaviour is unchanged.

This helps the Windows GUI to detect when a connection failure
results from a safer script-security setting enforced by the GUI,
and show a relevant message.

v2 changes as suggested by <davds@openvpn.net>

- define macros for return values of openvpn_execve()
- replace if/else by switch() in system_error_message()

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1550709982-19319-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18223.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/run_command.c
src/openvpn/run_command.h
src/openvpn/win32.c