From: Alexander Marx Date: Thu, 14 Mar 2013 05:11:28 +0000 (+0100) Subject: Forward Firewall: X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=f2ab6fba4afa7bc13a7549fade339eebc63c537b Forward Firewall: 1) Custom Hosts: now 17 chars can be entered into IP/MAC field 2) Forwardfw: Bugfix: When no alias is set and IPFIRE is selected as target, no target address is recognised 3) Forwardfw: Now source and Target addressfield (manual) are set to 17 chars maxlegth. 4) Converter: Bugfix: When starting converter from commandline, all hosts are entered into groups again. --- diff --git a/config/forwardfw/convert-outgoingfw b/config/forwardfw/convert-outgoingfw index ccb3ea423..f220738a6 100755 --- a/config/forwardfw/convert-outgoingfw +++ b/config/forwardfw/convert-outgoingfw @@ -174,7 +174,7 @@ sub new_hostgrp $name3="Custom Network"; } } - if($name2){ + if($name2 && !&check_grp($grp,$name2)){ my $grpkey = &General::findhasharraykey(\%groups); $groups{$grpkey}[0] = $grp; $groups{$grpkey}[1] = ''; @@ -204,7 +204,7 @@ sub new_hostgrp $name2=$name.$mac; $name3="Custom Host"; } - if($name2){ + if($name2 && !&check_grp($grp,$name2)){ my $grpkey = &General::findhasharraykey(\%groups); $groups{$grpkey}[0] = $grp; $groups{$grpkey}[1] = ''; diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index 5339f9e67..6ee2bbc63 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -74,7 +74,7 @@ my %ipsecsettings=(); my %aliases=(); my %optionsfw=(); -my $VERSION='0.9.8.4'; +my $VERSION='0.9.8.6'; my $color; my $confignet = "${General::swroot}/fwhosts/customnetworks"; my $confighost = "${General::swroot}/fwhosts/customhosts"; @@ -123,7 +123,6 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule') &General::readhasharray("$configfwdfw", \%configfwdfw); &General::readhasharray("$configinput", \%configinputfw); &General::readhasharray("$configoutgoing", \%configoutgoingfw); - $errormessage=&checksource; if(!$errormessage){&checktarget;} if(!$errormessage){&checkrule;} @@ -420,18 +419,18 @@ if ($fwdfwsettings{'ACTION'} eq $Lang::tr{'reset'}) &checkcounter($configfwdfw{$key}[5],$configfwdfw{$key}[6],,); &checkcounter($configfwdfw{$key}[14],$configfwdfw{$key}[15],,); } - &General::readhasharray("$configinput", \%configinputfw); - foreach my $key (sort keys %configinputfw){ - &checkcounter($configinputfw{$key}[3],$configinputfw{$key}[4],,); - &checkcounter($configinputfw{$key}[5],$configinputfw{$key}[6],,); - &checkcounter($configinputfw{$key}[14],$configinputfw{$key}[15],,); - } - + #&General::readhasharray("$configinput", \%configinputfw); + #foreach my $key (sort keys %configinputfw){ + # &checkcounter($configinputfw{$key}[3],$configinputfw{$key}[4],,); + # &checkcounter($configinputfw{$key}[5],$configinputfw{$key}[6],,); + # &checkcounter($configinputfw{$key}[14],$configinputfw{$key}[15],,); + #} + system("rm ${General::swroot}/forward/config"); - system("rm ${General::swroot}/forward/input"); + #system("rm ${General::swroot}/forward/input"); &General::writehash("${General::swroot}/forward/settings", \%fwdfwsettings); unless (-e "${General::swroot}/forward/config") { system("touch ${General::swroot}/forward/config"); } - unless (-e "${General::swroot}/forward/input") { system("touch ${General::swroot}/forward/input"); } + #unless (-e "${General::swroot}/forward/input") { system("touch ${General::swroot}/forward/input"); } my $MODE1=$fwdfwsettings{'POLICY1'}; %fwdfwsettings = (); $fwdfwsettings{'POLICY'}='MODE2'; @@ -717,14 +716,7 @@ sub checktarget $ip=&General::ip2dec($ip); $ip=&General::dec2ip($ip); - ##check if net or broadcast - #my @tmp= split (/\./,$ip); - #if ($tmp[3] eq "0" || ($tmp[3] eq "255")) - #{ - #$errormessage=$Lang::tr{'fwhost err hostip'}."
"; - #} $fwdfwsettings{'tgt_addr'}="$ip/$subnet"; - if(!&General::validipandmask($fwdfwsettings{'tgt_addr'})){ $errormessage.=$Lang::tr{'fwdfw err tgt_addr'}."
"; } @@ -1291,7 +1283,7 @@ sub getcolor foreach my $alias (sort keys %aliases) { if ($val eq $alias){ - $tdcolor="style='border: 2px solid red;'"; + $tdcolor="style='border: 1px solid $Header::colourred;'"; return; } } @@ -1318,7 +1310,7 @@ sub getcolor $tdcolor="style='border: 1px solid $Header::colourblue;'"; } }elsif ($val eq 'Default IP'){ - $tdcolor="style='border: 1px solid red;'"; + $tdcolor="style='border: 1px solid $Header::colourred;'"; }else{ $tdcolor=''; } @@ -1488,7 +1480,7 @@ print "
"; #------SOURCE------------------------------------------------------- print< - $Lang::tr{'fwdfw sourceip'} + $Lang::tr{'fwdfw sourceip'}
END @@ -1531,7 +1523,7 @@ END &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'}); print< - $Lang::tr{'fwdfw targetip'}IPFire + $Lang::tr{'fwdfw targetip'}IPFire END if (! -z "${General::swroot}/ethernet/aliases"){ print""; } print< @@ -1626,9 +1619,9 @@ END } if ($_ eq $fwdfwsettings{'RULE_ACTION'}) { - print""; + print""; }else{ - print""; + print""; } } } diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index fd1da8a7a..54080a97e 100755 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -455,7 +455,6 @@ if ($fwhostsettings{'ACTION'} eq 'savehost') foreach my $key (sort keys %customgrp){ if($customgrp{$key}[2] eq $fwhostsettings{'orgname'}){ $customgrp{$key}[2]=$fwhostsettings{'HOSTNAME'}; - last; } } &General::writehasharray("$configgrp", \%customgrp); @@ -1111,7 +1110,7 @@ sub addhost print< $Lang::tr{'name'}: - IP/MAC: + IP/MAC: $Lang::tr{'remark'}:

$Lang::tr{'fwhost attention'}
$Lang::tr{'fwhost macwarn'}