BUG10806: fix wrong customhostgroupcheck
Message ID | 1444979636-4110-1-git-send-email-alexander.marx@ipfire.org |
---|---|
State | Accepted |
Commit | 8b7417c50b8d3de46003bd40d779bef222dc4171 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.tremer.info [172.28.1.200]) by septima.ipfire.org (Postfix) with ESMTP id D1EE9620C2 for <patchwork@ipfire.org>; Fri, 16 Oct 2015 09:14:38 +0200 (CEST) Received: from hedwig.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 43C45D70; Fri, 16 Oct 2015 09:14:38 +0200 (CEST) Received: from nbk-edv.kappeln2011.lan (ip1f11b49c.dynamic.kabel-deutschland.de [31.17.180.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 2FF9CF9; Fri, 16 Oct 2015 09:14:25 +0200 (CEST) From: Alexander Marx <alexander.marx@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] BUG10806: fix wrong customhostgroupcheck Date: Fri, 16 Oct 2015 09:13:56 +0200 Message-Id: <1444979636-4110-1-git-send-email-alexander.marx@ipfire.org> X-Mailer: git-send-email 1.9.1 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Alexander Marx
Oct. 16, 2015, 6:13 p.m. UTC
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
---
html/cgi-bin/firewall.cgi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
What does this patch do? http://wiki.ipfire.org/devel/git/commit-messages On Fri, 2015-10-16 at 09:13 +0200, Alexander Marx wrote: > Signed-off-by: Alexander Marx <alexander.marx@ipfire.org> > --- > html/cgi-bin/firewall.cgi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi > index c207ec7..682c285 100644 > --- a/html/cgi-bin/firewall.cgi > +++ b/html/cgi-bin/firewall.cgi > @@ -597,7 +597,7 @@ sub checktarget > &General::readhasharray("$confighost", > \%customhost); > foreach my $grpkey (sort keys %customgrp){ > foreach my $hostkey (sort keys %customhost){ > - if ($customgrp{$grpkey}[2] eq > $customhost{$hostkey}[0] && $customhost{$hostkey}[1] eq 'mac'){ > + if ($customgrp{$grpkey}[2] eq > $customhost{$hostkey}[0] && $customgrp{$grpkey}[2] eq > $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostkey}[1] eq > 'mac'){ > $hint=$Lang::tr{'fwdfw hint > mac'}; > return $hint; > }
Am 16.10.2015 um 17:51 schrieb Michael Tremer: > What does this patch do? I think it should fix a design error. As you can see, the function is only executed, if a hostgroup is used as target. within the function, we read the hasharray of all defined hostgroups. unfortunately it checks not only the TARGET hostgroup but the source hostgroup as well if it contains a mac address. This leads to an error, if a hostgroup is used as source and contains a mac address. so with this patch i adapted the if construct only to raise the error, if a mac address is present in the TARGET hostgroup. > > http://wiki.ipfire.org/devel/git/commit-messages > > On Fri, 2015-10-16 at 09:13 +0200, Alexander Marx wrote: >> Signed-off-by: Alexander Marx <alexander.marx@ipfire.org> >> --- >> html/cgi-bin/firewall.cgi | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi >> index c207ec7..682c285 100644 >> --- a/html/cgi-bin/firewall.cgi >> +++ b/html/cgi-bin/firewall.cgi >> @@ -597,7 +597,7 @@ sub checktarget >> &General::readhasharray("$confighost", >> \%customhost); >> foreach my $grpkey (sort keys %customgrp){ >> foreach my $hostkey (sort keys %customhost){ >> - if ($customgrp{$grpkey}[2] eq >> $customhost{$hostkey}[0] && $customhost{$hostkey}[1] eq 'mac'){ >> + if ($customgrp{$grpkey}[2] eq >> $customhost{$hostkey}[0] && $customgrp{$grpkey}[2] eq >> $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostkey}[1] eq >> 'mac'){ >> $hint=$Lang::tr{'fwdfw hint >> mac'}; >> return $hint; >> }
Okay, could you please include descriptions like these in the commit messages? Please resend this patch, too. -Michael On Fri, 2015-10-16 at 19:54 +0200, Alexander Marx wrote: > > > Am 16.10.2015 um 17:51 schrieb Michael Tremer: > > What does this patch do? > I think it should fix a design error. As you can see, the function is > only executed, if a hostgroup is used as target. > within the function, we read the hasharray of all defined hostgroups. > unfortunately it checks not only the TARGET hostgroup but the source > hostgroup as well if it contains a mac address. This leads to an > error, if a hostgroup is used as source and contains a mac address. > so with this patch i adapted the if construct only to raise the > error, if a mac address is present in the TARGET hostgroup. > > > http://wiki.ipfire.org/devel/git/commit-messages > > > > On Fri, 2015-10-16 at 09:13 +0200, Alexander Marx wrote: > > > Signed-off-by: Alexander Marx <alexander.marx@ipfire.org> > > > --- > > > html/cgi-bin/firewall.cgi | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/html/cgi-bin/firewall.cgi b/html/cgi > > > -bin/firewall.cgi > > > index c207ec7..682c285 100644 > > > --- a/html/cgi-bin/firewall.cgi > > > +++ b/html/cgi-bin/firewall.cgi > > > @@ -597,7 +597,7 @@ sub checktarget > > > &General::readhasharray("$confighost", > > > \%customhost); > > > foreach my $grpkey (sort keys %customgrp){ > > > foreach my $hostkey (sort keys > > > %customhost){ > > > - if ($customgrp{$grpkey}[2] eq > > > $customhost{$hostkey}[0] && $customhost{$hostkey}[1] eq 'mac'){ > > > + if ($customgrp{$grpkey}[2] eq > > > $customhost{$hostkey}[0] && $customgrp{$grpkey}[2] eq > > > $fwdfwsettings{$fwdfwsettings{'grp2'}} && > > > $customhost{$hostkey}[1] eq > > > 'mac'){ > > > $hint=$Lang::tr{'fwdfw > > > hint > > > mac'}; > > > return $hint; > > > }