]> git.ipfire.org Git - people/amarx/ipfire-2.x.git/commitdiff
BUG:11312 BUG11312
authorAlexander Marx <alexander.marx@ipfire.org>
Thu, 5 Apr 2018 06:34:36 +0000 (08:34 +0200)
committerAlexander Marx <alexander.marx@ipfire.org>
Thu, 5 Apr 2018 06:34:36 +0000 (08:34 +0200)
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.

fixes: #11312

html/cgi-bin/fwhosts.cgi

index a2ade8a202f30cafc9592e632f638df7b45b888d..c342d46a11e442ea783b3c385af87464225898e6 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);