From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, fifteen, updated. 49da7d797547095ee8a13b079c63661e8e4aa1ad Date: Mon, 06 Jan 2014 14:37:56 +0100 Message-ID: <20140106133757.492E521543@argus.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7392588066805132556==" List-Id: --===============7392588066805132556== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, fifteen has been updated via 49da7d797547095ee8a13b079c63661e8e4aa1ad (commit) from 95e9415ada2cd29399eec02c2748ca22792ec0a4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 49da7d797547095ee8a13b079c63661e8e4aa1ad Author: Alexander Marx Date: Mon Jan 6 13:18:05 2014 +0100 Firewall: added check if firewallrules need to be updated when editing se= rvices or servicegroups ----------------------------------------------------------------------- Summary of changes: html/cgi-bin/fwhosts.cgi | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) Difference in files: diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 3e59a9d..ae135ab 100755 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -239,20 +239,12 @@ if ($fwhostsettings{'ACTION'} eq 'updateservice') foreach my $key (sort keys %customservicegrp){ if($customservicegrp{$key}[2] eq $fwhostsettings{'oldsrvname'}){ $customservicegrp{$key}[2] =3D $fwhostsettings{'SRV_NAME'}; + &checkrulereload($customservicegrp{$key}[0]); } } &General::writehasharray("$configsrvgrp", \%customservicegrp); - $needrules=3D'on'; - } - if($count gt 0 && $fwhostsettings{'oldsrvport'} ne $fwhostsettings{'SRV_PO= RT'} ){ - $needrules=3D'on'; - } - if($count gt 0 && $fwhostsettings{'oldsrvprot'} ne $fwhostsettings{'PROT'}= ){ - $needrules=3D'on'; - } - if($count gt 0 && $fwhostsettings{'oldsrvicmp'} ne $fwhostsettings{'ICMP'}= ){ - $needrules=3D'on'; } + &checkrulereload($fwhostsettings{'SRV_NAME'}); $fwhostsettings{'SRV_NAME'} =3D ''; $fwhostsettings{'SRV_PORT'} =3D ''; $fwhostsettings{'PROT'} =3D ''; @@ -266,9 +258,6 @@ if ($fwhostsettings{'ACTION'} eq 'updateservice') $fwhostsettings{'ICMP'} =3D $fwhostsettings{'oldsrvicmp'}; $fwhostsettings{'updatesrv'}=3D 'on'; } - if($needrules eq 'on'){ - &General::firewall_config_changed(); - } &addservice; } # save @@ -751,7 +740,6 @@ if ($fwhostsettings{'ACTION'} eq 'saveservicegrp') { my $prot; my $port; - my $count=3D0; my $tcpcounter=3D0; my $udpcounter=3D0; &General::readhasharray("$configsrvgrp", \%customservicegrp ); @@ -818,9 +806,7 @@ if ($fwhostsettings{'ACTION'} eq 'saveservicegrp') &General::writehasharray("$configsrvgrp", \%customservicegrp ); $fwhostsettings{'updatesrvgrp'}=3D'on'; } - if ($count gt 0){ - &General::firewall_config_changed(); - } + &checkrulereload($fwhostsettings{'SRVGRP_NAME'}); &addservicegrp; &viewtableservicegrp; } @@ -1938,6 +1924,33 @@ sub checkservicegroup } return $errormessage; } +sub checkrulereload +{ + my $search=3Dshift; + &General::readhasharray("$fwconfigfwd", \%fwfwd); + &General::readhasharray("$fwconfiginp", \%fwinp); + &General::readhasharray("$fwconfigout", \%fwout); + + #check if service or servicegroup is used in rules + foreach my $key (keys %fwfwd){ + if($search eq $fwfwd{$key}[15]){ + &General::firewall_config_changed(); + return; + } + } + foreach my $key (keys %fwinp){ + if($search eq $fwinp{$key}[15]){ + &General::firewall_config_changed(); + return; + } + } + foreach my $key (keys %fwout){ + if($search eq $fwout{$key}[15]){ + &General::firewall_config_changed(); + return; + } + } +} sub error { if ($errormessage) { hooks/post-receive -- IPFire 2.x development tree --===============7392588066805132556==--