A fixup for script-security error message

and parse the error msg from OpenVPN proposed
in patch #688 (patchwork)

(to be squashed with previous commit c7462ab)

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/271/head
Selva Nair 2019-02-13 14:41:50 -05:00
parent 5177cca014
commit df0f4f1786
1 changed files with 3 additions and 2 deletions

View File

@ -141,8 +141,9 @@ static void
SaveLastError(connection_t *c, const char *msg)
{
/* If we have enforced script security and there is script error, translate/re-word the error */
if (get_script_security(c) != SSEC_UNDEF
&& strstr(msg, "'--script-security 2' or higher is required to call user-defined scripts"))
if (!o.disable_ssec_override
&& get_script_security(c) != SSEC_UNDEF
&& strstr(msg, "disallowed by script-security setting"))
{
_sntprintf_0(c->last_error, LoadLocalizedString(IDS_ERR_SCRIPT_OVERRIDE));
}