BUG11825: firewall: Renaming a network/host group doesn't update rules

Code only changed field 6 of hash (target group) and not field 4 (source group).
Also if using geoip it was only field 4 of hash (source group) and not field 6 of hash (target group)
Added new code that changes both fields to reflect the change in the firewallrules immediately.

fixes: #11825

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Alexander Marx
2018-08-24 10:06:30 +02:00
committed by Michael Tremer
parent aec1925bea
commit 2754623fa9

View File

@@ -1258,6 +1258,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpname')
}
&General::writehasharray("$configgrp", \%customgrp );
#change name in FW Rules
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4);
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6);
}
}
@@ -1282,6 +1283,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpname')
&General::writehasharray("$configgeoipgrp", \%customgeoipgrp );
#change name in FW Rules
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4,"geoip");
&changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6,"geoip");
}
}
&addgeoipgrp;