From patchwork Fri Apr 27 01:31:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1729 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 8E1AE60134 for ; Thu, 26 Apr 2018 17:31:50 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id B94E9110933B; Thu, 26 Apr 2018 16:31:49 +0100 (BST) Authentication-Results: dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id F3044105FDFD for ; Thu, 26 Apr 2018 16:31:47 +0100 (BST) ARC-Authentication-Results: i=1; mx-nbg.link38.eu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1524756707; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=6nQ5olTTNNm3CB44d0bN92wDcWZeKgyXaUrZ6H7wKn4=; b=pJ3nJt7YIo4xlrcywdgz7lPPhES3p3Jw+B2YO52yPIeMNfj2gL8Wwe2RPpekY3yhhpqaSw HFKZttUrnDskS8C0skwAjBQtK5hn9vLE3eupjt2NLEgQ0ykTaBIzcCnaDPQK4blVFdBeZB vR0d3MXXJoiBpWqOQhA83rQHEkEfIU8ZWx5XmccnCeo99Ofdeb4rNY5yLETLcPxDMAqEEZ Rmg0+FrKBjmQF/4VoC4rOxADKPFgW8ZUXW1tIOWwElR0edK5OtQyH15nK70Uu6CJrJjs8m kJ7KouCDPguW3O6qJiWhGf54hCt1gHKfnzyBCECnGdKLniZsZsChnYW21t6RAw== ARC-Seal: i=1; s=201803; d=link38.eu; t=1524756707; a=rsa-sha256; cv=none; b=XxViYWP65QzmVDK7Ts2j79IG8avZjk2LPEur7bdkHUE69EuCMrzb1STGAuyrGPBXALcIcstnuXuauDIMhkE+jJd5KJKWCbFS5gvvMr0oY/wK9HAvY24SyBN85D48u0X3fua3e6cFQZcW1O78vDTbG269bSaGtGPf50BB3YcFEE5Iq8NBz+lDc72mvW3oE2vFjJ6w4J0hjvXngfDgibBADU+AelRE7qNtjA8MOWHaCkoEnoFLw74Qpqx2iYVSnkUPbDkJbikRnpGtjsP+5tqAzeFFg1rD10muRRsiCmmF0gs9u5/UCu9odLuDvqk0OL5/DJY5/czvyRMEC++A7gbaHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1524756707; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=6nQ5olTTNNm3CB44d0bN92wDcWZeKgyXaUrZ6H7wKn4=; b=+nDsT//pYY/jJYJJprTuFyCzJtGn8r0jrCyIKRue4LzQE5Dm1zhUq3jStaQxOUKcHUpuqL 9Hmqk0z8NGqtDdbjvpUn2/ZPF1VufA9Y5NbeTw4ESaEcHU9tWKcN5K1PUVRCK7w8dZCB/j UpUm9+w93DPR1zKiIlEVdgyEYtmaJxsUglJg2YFzh7izgRHY7rYoH/QvvPCr7GhBcTA8dn wBjVRJ69UoexNiU5y37+BTdUfSIf7qJTRFpj4jD/Ah44mZtnDC1jOzKvT6WN2VS5ntpx5R b3HxZXCzg9rbZWQs8YS/dvFdZntV5CGoqmojT3rZ3LyFXir3gRaNRvIzQCl9Rw== To: "IPFire: Development-List" , Alexander Marx From: =?utf-8?q?Peter_M=C3=BCller?= Subject: BUG:11312 When renaming a GeoIP Group, the corresponding names in firewallrules (if any) are not changed accordingly. Now when changing a GeoIP Group the firewallrules are renamed correctly. Message-ID: Date: Thu, 26 Apr 2018 17:31:46 +0200 MIME-Version: 1.0 Content-Language: en-US X-Spamd-Result: default: False [-7.52 / 11.00]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_MED(-2.00)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; IP_SCORE(-3.76)[ip: (-9.85), ipnet: 2a03:4000::/32(-4.92), asn: 197540(-3.95), country: DE(-0.09)]; ARC_REJECT(2.00)[seal check failed: fail, {[1] = sig:link38.eu:reject}]; BAYES_HAM(-3.00)[100.00%]; DKIM_TRACE(0.00)[link38.eu:+]; TO_DN_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_ALLOW(-0.20)[link38.eu]; ASN(0.00)[asn:197540, ipnet:2a03:4000::/32, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-7.52 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" Slightly improved first version of this patch (contained a blank line with trailing whitespace). No functionality changed, patch has been confirmed as working correctly. Fixes: #11312 Signed-off-by: Peter Müller Signed-off-by: Alexander Marx --- html/cgi-bin/fwhosts.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index a2ade8a20..10217425d 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -1278,7 +1278,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegeoipgrpname') } &General::writehasharray("$configgeoipgrp", \%customgeoipgrp ); #change name in FW Rules - &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},6); + &changenameinfw($fwhostsettings{'oldgrpname'},$fwhostsettings{'grp'},4,"geoip"); } } &addgeoipgrp; @@ -3052,6 +3052,12 @@ sub changenameinfw my $old=shift; my $new=shift; my $fld=shift; + my $type=shift; + + if ($type eq 'geoip'){ + $old="group:$old"; + $new="group:$new"; + } &General::readhasharray("$fwconfigfwd", \%fwfwd); &General::readhasharray("$fwconfiginp", \%fwinp); &General::readhasharray("$fwconfigout", \%fwout);