From patchwork Fri Aug 24 18:06:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Marx X-Patchwork-Id: 1900 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id A0EBD61842 for ; Fri, 24 Aug 2018 10:06:35 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 0190110FFEAE; Fri, 24 Aug 2018 09:06:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1535097995; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:list-id: list-unsubscribe:list-subscribe:list-post; bh=7pn/ALIy0Ej36cAn33YkuTuIzCmqncTewsERNw5Ddrs=; b=vQ4TC0JQOTkquJBEGq6JoJLJTdRFhRNv7JSUiYUtYk62KVu6fZau5x+CGPfSEGMhZRjqKA RZiX6ncvxzIUa5i5lCZi1vneHfBQXpa0usDdU0xQTuBLYRn4hoU9ZHehPYY8yRugBe9MNX w4q9XUm6+IzkK8tOArtXpkKVIjFbhmGTnMNmUciKcj2E27eRAuKV2jM6dQ3lyzqMBKlpNi go47dfyAXIifNCnCrf/ZJuSiHSO0PjRUVv7bUUnwBxkXvCnhxxs4a+XeVy3hz63LOKshzn 2Lr4Xs3nciwDS/Bjp9th1mX5GEUek/FbKz/67sfo037BUUrcR4m2Jfnjv+k61Q== Received: from localhost.localdomain (business-90-187-3-157.pool2.vodafone-ip.de [90.187.3.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id AEDA4109102F; Fri, 24 Aug 2018 09:06:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1535097992; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=7pn/ALIy0Ej36cAn33YkuTuIzCmqncTewsERNw5Ddrs=; b=l61wVju16ecouQYhFcAbofzkQaqXKruJ/6HyhbTuR4yfVPXms7CloPavgyvIjXM/pF4M3g wEjKWGnwC+Uce+x3sk9q3QwIODfLgx8d1fpGeO2Q5Wc2tyUmMFjLcZzVxUSOcOUUL0sPu5 hseQRMxLsFbxkyH6iyEuKnBy8OMxTdnULI6p/gEA9cD/AsmakFnnpMiS9tWkRjgd3hGqZd /+9HNrz4nX/Y52T9dAKnHiurOguPCZiGwbHSgY44+Ls6oN9itEStRgRuciHydtq7nAzXDI Kvc8Gxxf/eD6PzUHdOdy5rbgyO3P8HL7KIDQ8tmrycsp9iMNCRtipGmEbIffdw== From: Alexander Marx To: development@lists.ipfire.org Subject: [PATCH] BUG11825: firewall: Renaming a network/host group doesn't update rules Date: Fri, 24 Aug 2018 10:06:30 +0200 Message-Id: <20180824080630.9612-1-alexander.marx@ipfire.org> X-Mailer: git-send-email 2.17.1 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=amarx smtp.mailfrom=alexander.marx@ipfire.org X-Spamd-Result: default: False [-2.10 / 11.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:31334, ipnet:90.187.0.0/16, country:DE]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-2.10 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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 --- html/cgi-bin/fwhosts.cgi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 576701ac6..7315e79b6 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -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;