]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
BUG:11312 Fix renaming GeoIP groups
authorPeter Müller <peter.mueller@link38.eu>
Thu, 26 Apr 2018 15:31:46 +0000 (17:31 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Apr 2018 10:04:05 +0000 (11:04 +0100)
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>
html/cgi-bin/fwhosts.cgi

index a2ade8a202f30cafc9592e632f638df7b45b888d..10217425d9a62b0792dc0cf0cc3e9ecd729176b8 100644 (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);