This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, next has been updated via 86228a56efb74663eb3545d4e75ec59c5a2a8b1e (commit) from 3765eb6179d721093c834e3483fdef8232b5b486 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 86228a56efb74663eb3545d4e75ec59c5a2a8b1e Author: Michael Tremer michael.tremer@ipfire.org Date: Mon Aug 19 17:33:23 2013 +0200
ovpnmain.cgi: Fix remote IP address validation.
-----------------------------------------------------------------------
Summary of changes: html/cgi-bin/ovpnmain.cgi | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-)
Difference in files: diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 5e18d3c..e6ea1ef 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -3604,35 +3604,33 @@ if ($cgiparams{'TYPE'} eq 'net') { }
# Check if a remote host/IP has been set for the client. - if ($cgiparams{'REMOTE'} eq '' && $cgiparams{'SIDE'} ne 'server') { - $errormessage = $Lang::tr{'invalid input for remote host/ip'}; + if ($cgiparams{'TYPE'} eq 'net') { + if ($cgiparams{'SIDE'} ne 'server' && $cgiparams{'REMOTE'} eq '') { + $errormessage = $Lang::tr{'invalid input for remote host/ip'};
- # Check if this is a N2N connection and drop temporary config. - if ($cgiparams{'TYPE'} eq 'net') { - 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; - } + # Check if this is a N2N connection and drop temporary config. + 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: $!";
- # Check if a remote host/IP has been configured - the field can be empty on the server side. - if ($cgiparams{'REMOTE'} ne '') { + goto VPNCONF_ERROR; + }
- # Check if the given IP is valid - otherwise check if it is a valid domain. - if (! &General::validip($cgiparams{'REMOTE'})) { + # Check if a remote host/IP has been configured - the field can be empty on the server side. + if ($cgiparams{'REMOTE'} ne '') { + # Check if the given IP is valid - otherwise check if it is a valid domain. + if (! &General::validip($cgiparams{'REMOTE'})) { + # Check for a valid domain. + if (! &General::validfqdn ($cgiparams{'REMOTE'})) { + $errormessage = $Lang::tr{'invalid input for remote host/ip'};
- # Check for a valid domain. - if (! &General::validfqdn ($cgiparams{'REMOTE'})) { - $errormessage = $Lang::tr{'invalid input for remote host/ip'}; + # Check if this is a N2N connection and drop temporary config. + 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: $!";
- # Check if this is a N2N connection and drop temporary config. - if ($cgiparams{'TYPE'} eq 'net') { - 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; + goto VPNCONF_ERROR; + } + } } - } }
if ($cgiparams{'TYPE'} ne 'host') {
hooks/post-receive -- IPFire 2.x development tree