From: <ow...@us...> - 2009-10-31 19:03:08
|
Revision: 3771 http://ipcop.svn.sourceforge.net/ipcop/?rev=3771&view=rev Author: owes Date: 2009-10-31 19:02:58 +0000 (Sat, 31 Oct 2009) Log Message: ----------- Fix several unitialized value errors and a NetAddr::IP load error Modified Paths: -------------- ipcop/trunk/config/rootfiles/common/NetAddr-IP ipcop/trunk/html/cgi-bin/openvpn.cgi Modified: ipcop/trunk/config/rootfiles/common/NetAddr-IP =================================================================== --- ipcop/trunk/config/rootfiles/common/NetAddr-IP 2009-10-31 18:24:27 UTC (rev 3770) +++ ipcop/trunk/config/rootfiles/common/NetAddr-IP 2009-10-31 19:02:58 UTC (rev 3771) @@ -13,7 +13,7 @@ #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/Util.bs #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/Util.so -#usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/autosplit.ix +usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/autosplit.ix usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/inet_any2n.al #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/inet_n2ad.al usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/Util/inet_n2dx.al @@ -53,7 +53,7 @@ #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/_compact_v6.al #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/_splitplan.al #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/_splitref.al -#usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/autosplit.ix +usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/autosplit.ix #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/coalesce.al #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/compactref.al #usr/lib/perl5/site_perl/PERLVER/MACHINE-linux/auto/NetAddr/IP/do_prefix.al Modified: ipcop/trunk/html/cgi-bin/openvpn.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/openvpn.cgi 2009-10-31 18:24:27 UTC (rev 3770) +++ ipcop/trunk/html/cgi-bin/openvpn.cgi 2009-10-31 19:02:58 UTC (rev 3771) @@ -1331,7 +1331,7 @@ # Verify the certificate has a valid CA and move it my $validca = 0; - my $test = `/usr/bin/openssl verify -CAfile ${General::swroot}/openvpn/ca/cacert.pem $filename`; + my $test = `/usr/bin/openssl verify -CAfile /var/ipcop/openvpn/ca/cacert.pem $filename`; if ($test =~ /: OK/) { $validca = 1; } @@ -1771,13 +1771,18 @@ ### Default status page ### %cgiparams = (); +$cgiparams{'ENABLED_RED_1'} = 'off'; +$cgiparams{'ENABLED_BLUE_1'} = 'off'; +$cgiparams{'ENABLED_ORANGE_1'} = 'off'; +$cgiparams{'DDEVICE'} = 'tun'; %cahash = (); &General::readhash('/var/ipcop/openvpn/settings', \%cgiparams); &General::readhasharray('/var/ipcop/openvpn/caconfig', \%cahash); my @status = `/bin/cat /var/log/openvpnserver.log`; -if ($cgiparams{'VPN_IP'} eq '' && -e '/var/ipcop/red/active') { +# Defaults for several settings +if ((!defined($cgiparams{'VPN_IP'}) || ($cgiparams{'VPN_IP'} eq '')) && -e '/var/ipcop/red/active') { if (open(IPADDR, '/var/ipcop/red/local-ipaddress')) { my $ipaddr = <IPADDR>; close IPADDR; @@ -1789,19 +1794,19 @@ } } -if ($cgiparams{'DCIPHER'} eq '') { +if (!defined($cgiparams{'DCOMPLZO'}) || ($cgiparams{'DCIPHER'} eq '')) { $cgiparams{'DCIPHER'} = 'BF-CBC'; } -# if ($cgiparams{'DCOMPLZO'} eq '') { -# $cgiparams{'DCOMPLZO'} = 'on'; -# } -if ($cgiparams{'DDEST_PORT'} eq '') { +if (!defined($cgiparams{'DCOMPLZO'}) || ($cgiparams{'DCOMPLZO'} eq '')) { + $cgiparams{'DCOMPLZO'} = 'off'; +} +if (!defined($cgiparams{'DDEST_PORT'}) || ($cgiparams{'DDEST_PORT'} eq '')) { $cgiparams{'DDEST_PORT'} = '1194'; } -if ($cgiparams{'DMTU'} eq '') { +if (!defined($cgiparams{'DMTU'}) || ($cgiparams{'DMTU'} eq '')) { $cgiparams{'DMTU'} = '1400'; } -if ($cgiparams{'DOVPN_SUBNET'} eq '') { +if (!defined($cgiparams{'DOVPN_SUBNET'}) || ($cgiparams{'DOVPN_SUBNET'} eq '')) { $cgiparams{'DOVPN_SUBNET'} = '10.' . int(rand(256)) . '.' . int(rand(256)) . '.0/255.255.255.0'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |