From patchwork Sun Jul 11 17:54:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 4509 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4GNF0833zpz3xCm for ; Sun, 11 Jul 2021 17:54:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4GNF0773plz2R9; Sun, 11 Jul 2021 17:54:31 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4GNF076hsRz2xnh; Sun, 11 Jul 2021 17:54:31 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4GNF045vG8z2ylL for ; Sun, 11 Jul 2021 17:54:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4GNF041nSGz14j; Sun, 11 Jul 2021 17:54:28 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1626026068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vkGWyxq9e1WxTc6axxrar8+muOyNCo/+Glnx7ekgHJ8=; b=yqLUk8w7r6JPdS6yX4AivBNQNYXtC8WfF2/jMFcV3ZTlfTHdllEmgKfNeMjphUCpv79GIg AFlUc6RFyNhV0gCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1626026068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vkGWyxq9e1WxTc6axxrar8+muOyNCo/+Glnx7ekgHJ8=; b=ktbgdNximdZWqS0NP/ha12+B1d9Id4+tlJ57DZGL/fBQ9f9Wur99MSS5wlobveGZzGRnn6 JHAFt+MZEXozzLVjEOE2kQE0rEAOCAJSzG/vOHGbJ0H7QRxmaIlhL228VsL/Os21zpXG+Z 3l4iKrj1flyWMt0keamh4BICFZOsaouMGsFKOAc4KhLYVpzp6oBWiQhb46p2bULrmP5y7M BZrAFE0jGrV86+byO/uRnZ4eDxK7FzNoCG2g+7No8VxX+UDbXOOgbqlRNE4dxtxVPTZnVi Ye0dXnUF+ZnZ5OxqTOVbaVougJ7exs5eVGrvDRgQMB2AP+jVYqTCrihvOeQ2Iw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/3] firewall.cgi: Make checked and selected hashes private for each single function. Date: Sun, 11 Jul 2021 19:54:18 +0200 Message-Id: <20210711175419.3582-3-stefan.schantl@ipfire.org> In-Reply-To: <20210711175419.3582-1-stefan.schantl@ipfire.org> References: <20210711175419.3582-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Some functions uses those two hashes and are altering them - making them private will erase and fill it with new data. Signed-off-by: Stefan Schantl --- html/cgi-bin/firewall.cgi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 8d6adee96..0eace5f11 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -1005,6 +1005,10 @@ sub gen_dd_block my $grp=shift; my $helper=''; my $show=''; + + my %checked = (); + my %selected = (); + $checked{'grp1'}{$fwdfwsettings{'grp1'}} = 'CHECKED'; $checked{'grp2'}{$fwdfwsettings{'grp2'}} = 'CHECKED'; $checked{'grp3'}{$fwdfwsettings{'grp3'}} = 'CHECKED'; @@ -1482,7 +1486,10 @@ sub newrule &General::readhasharray("$configlocationgrp", \%customlocationgrp); &General::readhasharray("$configipsec", \%ipsecconf); &General::get_aliases(\%aliases); - my %checked=(); + + my %checked = (); + my %selected = (); + my $helper; my $sum=0; if($fwdfwsettings{'config'} eq ''){$fwdfwsettings{'config'}=$configfwdfw;}