BUG:11312 Fix renaming GeoIP groups

When renaming a GeoIP Group, the corresponding names in
firewallrules (if any) are not changed accordingly. Now
when changing a GeoIP Group the firewallrules are renamed
correctly.

Slightly improved first version of this patch (contained
a blank line with trailing whitespace). No functionality
changed, patch has been confirmed as working correctly.

Fixes: #11312
Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Peter Müller
2018-04-26 17:31:46 +02:00
committed by Michael Tremer
parent 86fd194766
commit 40a930bda5

View File

@@ -1278,7 +1278,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpname')
}
&General::writehasharray("$configgeoipgrp", \%customgeoipgrp );
#change name in FW Rules
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6);
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4,"geoip");
}
}
&addgeoipgrp;
@@ -3052,6 +3052,12 @@ sub changenameinfw
my $old=shift;
my $new=shift;
my $fld=shift;
my $type=shift;
if ($type eq 'geoip'){
$old="group:$old";
$new="group:$new";
}
&General::readhasharray("$fwconfigfwd", \%fwfwd);
&General::readhasharray("$fwconfiginp", \%fwinp);
&General::readhasharray("$fwconfigout", \%fwout);