From 4e17adadcd3c3942e7c2222485fbf88608a4477f Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Thu, 14 Jun 2007 18:56:04 +0000 Subject: [PATCH] Einige CGIs gefixt, SNORT wird beim Systemstart gestartet git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@629 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- html/cgi-bin/ids.cgi | 4 ++-- html/cgi-bin/media.cgi | 2 +- html/cgi-bin/ovpnmain.cgi | 42 ++++++++++++++-------------------- html/cgi-bin/proxy.cgi | 16 ++++++------- html/cgi-bin/vpnmain.cgi | 4 ++-- src/initscripts/init.d/network | 12 +++++++--- 6 files changed, 39 insertions(+), 41 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index c428f4c0c8..750514ed7a 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -223,7 +223,7 @@ if (-e "/etc/snort/snort.conf") { close(FILE); if ($restartsnortrequired) { - system('/usr/local/bin/restartsnort','red','orange','blue','green'); + system('/usr/local/bin/snortctrl','restart'); } } @@ -271,7 +271,7 @@ if ($snortsettings{'ACTION'} eq $Lang::tr{'save'}) unlink "${General::swroot}/snort/enable_orange"; } - system('/usr/local/bin/restartsnort','red','orange','blue','green'); + system('/usr/local/bin/snortctrl','restart'); } else { # INSTALLMD5 is not in the form, so not retrieved by getcgihash diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index 54aa3ba5a0..ccf882e4fc 100644 --- a/html/cgi-bin/media.cgi +++ b/html/cgi-bin/media.cgi @@ -135,7 +135,7 @@ my $i=0; for(my $i = 1; $i <= $#iostat1; $i++) { if ( $i eq '1' ){print "DeviceMB readMB writen";} -else {print "@iostat1[$i]@iostat2[$i]@iostat3[$i]";} +else {print "$iostat1[$i]$iostat2[$i]$iostat3[$i]";} } print "\n"; &Header::closebox(); diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 3a97c96af0..e427fb2907 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -324,7 +324,7 @@ sub writeserverconf { print CONF "keepalive $sovpnsettings{'KEEPALIVE_1'} $sovpnsettings{'KEEPALIVE_2'}\n"; } print CONF "status-version 1\n"; - print CONF "status /var/ipfire/ovpn/server.log 30\n"; + print CONF "status /var/log/ovpnserver.log 30\n"; print CONF "cipher $sovpnsettings{DCIPHER}\n"; if ($sovpnsettings{DCOMPLZO} eq 'on') { print CONF "comp-lzo\n"; @@ -368,7 +368,7 @@ sub writeserverconf { } # sub emptyserverlog{ - if (open(FILE, ">${General::swroot}/ovpn/server.log")) { + if (open(FILE, ">/var/log/ovpnserver.log")) { flock FILE, 2; print FILE ""; close FILE; @@ -1620,7 +1620,7 @@ END END ; - my $filename = "${General::swroot}/ovpn/server.log"; + my $filename = "/var/log/ovpnserver.log"; open(FILE, $filename) or die 'Unable to open config file.'; my @current = ; close(FILE); @@ -1669,9 +1669,9 @@ END if ($user2 >= 1){ for (my $idx = 1; $idx <= $user2; $idx++){ if ($idx % 2) { - print "\n"; + print "\n"; } else { - print "\n"; + print "\n"; } print "$users[$idx-1]{'CommonName'}"; print "$users[$idx-1]{'RealAddress'}"; @@ -2470,7 +2470,7 @@ END &General::readhasharray("${General::swroot}/ovpn/caconfig", \%cahash); &General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash); - my @status = `/bin/cat /var/ipfire/ovpn/server.log`; + my @status = `/bin/cat /var/log/ovpnserver.log`; if ($cgiparams{'VPN_IP'} eq '' && -e "${General::swroot}/red/active") { if (open(IPADDR, "${General::swroot}/red/local-ipaddress")) { @@ -2583,10 +2583,8 @@ END print ""; } print <$Lang::tr{'local vpn hostname/ip'}: - - $Lang::tr{'ovpn subnet'} - + $Lang::tr{'local vpn hostname/ip'}:
+ $Lang::tr{'ovpn subnet'}
$Lang::tr{'ovpn device'} @@ -2657,7 +2655,7 @@ EOF $casubject =~ s/ ST=/ S=/; print < + $Lang::tr{'root certificate'} $casubject
@@ -2674,7 +2672,7 @@ END } else { # display rootcert generation buttons print < + $Lang::tr{'root certificate'}: $Lang::tr{'not present'}   @@ -2690,7 +2688,7 @@ END $hostsubject =~ s/ ST=/ S=/; print < + $Lang::tr{'host certificate'} $hostsubject @@ -2707,7 +2705,7 @@ END } else { # Nothing print < + $Lang::tr{'host certificate'}: $Lang::tr{'not present'}   @@ -2724,9 +2722,9 @@ END if (keys %cahash > 0) { foreach my $key (keys %cahash) { if (($key + 1) % 2) { - print "\n"; + print "\n"; } else { - print "\n"; + print "\n"; } print "$cahash{$key}[0]\n"; print "$cahash{$key}[1]\n"; @@ -2774,8 +2772,7 @@ END $Lang::tr{'ca name'}: - - +
END ; @@ -2807,9 +2804,9 @@ END if ($confighash{$key}[0] eq 'on') { $gif = 'on.gif'; } else { $gif = 'off.gif'; } if ($id % 2) { - print "\n"; + print "\n"; } else { - print "\n"; + print "\n"; } print "$confighash{$key}[1]"; print "" . $Lang::tr{"$confighash{$key}[3]"} . " (" . $Lang::tr{"$confighash{$key}[4]"} . ")"; @@ -2953,9 +2950,4 @@ END ; &Header::closebox(); } - print "$Lang::tr{'this feature has been sponsored by'} : "; - print "Star Events Group Ltd.\n"; - print "IBDOZING.\n"; - print "Xen by x|encon.\n"; - print "SAVATEC e.K..\n"; &Header::closepage(); diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index 58cf5c83fa..639a700e3c 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -367,7 +367,7 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} { chomp; @useragent = split(/,/); - if ($proxysettings{'UA_'.@useragent[0]} eq 'on') { $browser_regexp .= "@useragent[2]|"; } + if ($proxysettings{'UA_'.$useragent[0]} eq 'on') { $browser_regexp .= "$useragent[2]|"; } } chop($browser_regexp); if (!$browser_regexp) @@ -742,9 +742,9 @@ $checked{'ENABLE_BROWSER_CHECK'}{$proxysettings{'ENABLE_BROWSER_CHECK'}} = "chec foreach (@useragentlist) { @useragent = split(/,/); - $checked{'UA_'.@useragent[0]}{'off'} = ''; - $checked{'UA_'.@useragent[0]}{'on'} = ''; - $checked{'UA_'.@useragent[0]}{$proxysettings{'UA_'.@useragent[0]}} = "checked='checked'"; + $checked{'UA_'.$useragent[0]}{'off'} = ''; + $checked{'UA_'.$useragent[0]}{'on'} = ''; + $checked{'UA_'.$useragent[0]}{$proxysettings{'UA_'.$useragent[0]}} = "checked='checked'"; } $checked{'AUTH_METHOD'}{'none'} = ''; @@ -1491,8 +1491,8 @@ for ($n=0; $n<=@useragentlist; $n = $n + $i) { if ($i eq 0) { print "\n"; } if (($n+$i) < @useragentlist) { @useragent = split(/,/,@useragentlist[$n+$i]); - print "@useragent[1]:<\/td>\n"; - print "\n"; + print "$useragent[1]:<\/td>\n"; + print "\n"; } if ($i eq 3) { print "<\/tr>\n"; } } @@ -2155,9 +2155,9 @@ END if($proxysettings{'ACTION'} eq $Lang::tr{'edit'} && $proxysettings{'ID'} eq $line) { print "\n"; } elsif ($id % 2) { - print "\n"; } + print "\n"; } else { - print "\n"; } + print "\n"; } print <$temp[0] diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi index 627fcfe22b..6abfa8fac2 100644 --- a/html/cgi-bin/vpnmain.cgi +++ b/html/cgi-bin/vpnmain.cgi @@ -6,8 +6,8 @@ use File::Temp qw/ tempfile tempdir /; use strict; # enable only the following on debugging purpose -#use warnings; -#use CGI::Carp 'fatalsToBrowser'; +use warnings; +use CGI::Carp 'fatalsToBrowser'; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; diff --git a/src/initscripts/init.d/network b/src/initscripts/init.d/network index acc48d22da..c0ab4dfd8a 100644 --- a/src/initscripts/init.d/network +++ b/src/initscripts/init.d/network @@ -121,8 +121,11 @@ case "${DO}" in fi fi - boot_mesg "Setting OVPN Rules if enabled" - /etc/rc.d/init.d/firewall startovpn; evaluate_retval + boot_mesg "Setting OpenVPN Rules if enabled" + /etc/rc.d/init.d/firewall startovpn; evaluate_retval + + boot_mesg "Starting SNORT if enabled" + /etc/rc.d/init.d/snort start; evaluate_retval ;; stop) @@ -153,8 +156,11 @@ case "${DO}" in fi fi - boot_mesg "Deleting OVPN Rules if enabled" + boot_mesg "Deleting OpenVPN Rules if enabled" /etc/rc.d/init.d/firewall stopovpn; evaluate_retval + + boot_mesg "Starting SNORT if enabled" + /etc/rc.d/init.d/snort stop; evaluate_retval ;; restart) -- 2.39.2