From 34f30c5f926e1ca90451cc42d72af230f66406ea Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Fri, 12 Jul 2013 11:05:57 +0200 Subject: [PATCH] Forward Firewall: set default options for optionsfw and minor change on optionsfw.cgi --- html/cgi-bin/optionsfw.cgi | 32 ++++---------------------------- lfs/configroot | 2 ++ 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/html/cgi-bin/optionsfw.cgi b/html/cgi-bin/optionsfw.cgi index 61441e4706..73a2f59a6a 100644 --- a/html/cgi-bin/optionsfw.cgi +++ b/html/cgi-bin/optionsfw.cgi @@ -22,10 +22,6 @@ require "${General::swroot}/header.pl"; my %checked =(); # Checkbox manipulations - -# File used -my $filename = "${General::swroot}/optionsfw/settings"; - our %settings=(); my %fwdfwsettings=(); my %configfwdfw=(); @@ -33,37 +29,18 @@ my %configoutgoingfw=(); my $configfwdfw = "${General::swroot}/forward/config"; my $configoutgoing = "${General::swroot}/forward/outgoing"; - -$settings{'DISABLEPING'} = 'NO'; -$settings{'DROPNEWNOTSYN'} = 'on'; -$settings{'DROPINPUT'} = 'on'; -$settings{'DROPFORWARD'} = 'on'; -$settings{'DROPOUTGOING'} = 'on'; -$settings{'DROPPORTSCAN'} = 'on'; -$settings{'DROPWIRELESSINPUT'} = 'on'; -$settings{'DROPWIRELESSFORWARD'} = 'on'; -$settings{'SHOWCOLORS'} = 'off'; -$settings{'SHOWREMARK'} = 'on'; -$settings{'SHOWTABLES'} = 'on'; -$settings{'SHOWDROPDOWN'} = 'off'; - my $errormessage = ''; my $warnmessage = ''; +my $filename = "${General::swroot}/optionsfw/settings"; &General::readhash("${General::swroot}/forward/settings", \%fwdfwsettings); &Header::showhttpheaders(); #Get GUI values &Header::getcgihash(\%settings); -&General::readhash("${General::swroot}/optionsfw/settings", \%settings); - - if ($settings{'ACTION'} eq $Lang::tr{'save'}) { if ($settings{'defpol'} ne '1'){ - $errormessage = $Lang::tr{'new optionsfw later'}; - delete $settings{'__CGI__'}; - delete $settings{'x'}; - delete $settings{'y'}; + $errormessage .= $Lang::tr{'new optionsfw later'}; &General::writehash($filename, \%settings); # Save good settings system("/usr/local/bin/forwardfwctrl"); }else{ @@ -82,13 +59,12 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) { &General::readhash("${General::swroot}/forward/settings", \%fwdfwsettings); system("/usr/local/bin/forwardfwctrl"); } - }else { - &General::readhash($filename, \%settings); # Get saved settings and reset to good if needed + &General::readhash($filename, \%settings); # Load good settings } &Header::openpage($Lang::tr{'options fw'}, 1, ''); &Header::openbigbox('100%', 'left', '', $errormessage); - +&General::readhash($filename, \%settings); if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'warning messages'}); print "$errormessage "; diff --git a/lfs/configroot b/lfs/configroot index 4268f1502b..341b146326 100644 --- a/lfs/configroot +++ b/lfs/configroot @@ -129,6 +129,8 @@ $(TARGET) : echo "SHOWCOLORS=on" >> $(CONFIG_ROOT)/optionsfw/settings echo "SHOWTABLES=off" >> $(CONFIG_ROOT)/optionsfw/settings echo "SHOWDROPDOWN=off" >> $(CONFIG_ROOT)/optionsfw/settings + echo "DROPWIRELESSINPUT=off" >> $(CONFIG_ROOT)/optionsfw/settings + echo "DROPWIRELESSFORWARD=off" >> $(CONFIG_ROOT)/optionsfw/settings echo "POLICY=MODE2" >> $(CONFIG_ROOT)/forward/settings echo "POLICY1=MODE2" >> $(CONFIG_ROOT)/forward/settings -- 2.39.2