From bfac6bd4dc79788c16d66b29b84d3ecb6d105653 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Fri, 8 Feb 2013 06:00:41 +0100 Subject: [PATCH] Forward Firewall: when a service is used in a servicegroup, it was not updated when editing the service --- html/cgi-bin/fwhosts.cgi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index c23c90937..6ce7ac8df 100755 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -151,7 +151,6 @@ if ($fwhostsettings{'ACTION'} eq 'updateservice') $customservice{$key1}[3] = $fwhostsettings{'ICMP_TYPES'}; $customservice{$key1}[4] = $count; &General::writehasharray("$configsrv", \%customservice); - #check if we need to update firewallrules if ($fwhostsettings{'SRV_NAME'} ne $fwhostsettings{'oldsrvname'}){ if ( ! -z $fwconfigfwd ){ @@ -172,9 +171,19 @@ if ($fwhostsettings{'ACTION'} eq 'updateservice') } &General::writehasharray("$fwconfiginp", \%fwinp); } + #check if we need to update groups + &General::readhasharray("$configsrvgrp", \%customservicegrp); + foreach my $key (sort keys %customservicegrp){ + if($customservicegrp{$key}[2] eq $fwhostsettings{'oldsrvname'}){ + $customservicegrp{$key}[2] = $fwhostsettings{'SRV_NAME'}; + } + } + &General::writehasharray("$configsrvgrp", \%customservicegrp); + $needrules='on'; } + if($count gt 0 && $fwhostsettings{'oldsrvport'} ne $fwhostsettings{'SRV_PORT'} ){ $needrules='on'; }