--- html/cgi-bin/ovpnmain.cgi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 8f45f04..9c383f7 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -4040,11 +4040,13 @@ if ($cgiparams{'TYPE'} eq 'net') { }
# Check that OpenSSL maximum of valid days won´t be exceeded - if (length($cgiparams{'DAYS_VALID'}) > 6) { - $errormessage = $Lang::tr{'invalid input for valid till days'}; - unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!"; - rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!"; - goto VPNCONF_ERROR; + if ($cgiparams{'TYPE'} eq 'net') { + if ($cgiparams{'DAYS_VALID'} > '999999') { + $errormessage = $Lang::tr{'invalid input for valid till days'}; + unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!"; + rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!"; + goto VPNCONF_ERROR; + } }
if ($cgiparams{'ENABLED'} !~ /^(on|off)$/) { @@ -4230,7 +4232,7 @@ if ($cgiparams{'TYPE'} eq 'net') { }
# Check that OpenSSL maximum of valid days won´t be exceeded - if (length($cgiparams{'DAYS_VALID'}) > 6) { + if ($cgiparams{'DAYS_VALID'} > '999999') { $errormessage = $Lang::tr{'invalid input for valid till days'}; goto VPNCONF_ERROR; }