From patchwork Sun Mar 13 19:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5346 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4KGqSV2zSPz3xK1 for ; Sun, 13 Mar 2022 19:27:38 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4KGqSS1ffjz1PB; Sun, 13 Mar 2022 19:27:36 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KGqSR7319z2ydK; Sun, 13 Mar 2022 19:27:35 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4KGqSQ16wsz2xLr for ; Sun, 13 Mar 2022 19:27:34 +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 4KGqSN4WctzTp; Sun, 13 Mar 2022 19:27:32 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1647199652; 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; bh=ppleIAtHSSwz41AOoIoIy387HAc30/DXL/NI5fwnya8=; b=tjLQNwsRTRa4q5DRWdqhAmmekZEK2KXQ1EMELyb10dUKqSSOC0Cg2UxZ9F0hS7oJkfJt15 j4baM3i0es43WZDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1647199652; 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; bh=ppleIAtHSSwz41AOoIoIy387HAc30/DXL/NI5fwnya8=; b=gYFm8z/4vho/qD/m+CO4TwqMB+8qXViasw5S4M7tFAmIRmNr/Mk2Wm2G+loJQgAyzvWEPy uTt0ph/2dmCJXqV+20KnGuZudJchDw7Qiv3mOddOGdDKekth+yG6ymYBN1/7+C8eBHsoJE RQuMCIthRlBCkFOet5wzIFK825o3rZfgcA+JbvCzpIjOhWp2zGUDEV8figCrsRcjzPDXim PZJSByMurij3iHRZ4BZhZEEALRpcjDWoMk81ElHcfPexMppgRgx1QtwZl8TJJB9SnUNMwb E8Yv4+nbiFgQ2C++/Yatq3AEo7o8KCtEPsQd0+FfdQquSHdtVrZO/6RpRgP9yw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] ids-functions.pl: Do not longer extract all rulefiles in archive. Date: Sun, 13 Mar 2022 20:27:25 +0100 Message-Id: <20220313192725.3955-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" Only extract rulefiles which are located in a rules directory and/or in the archive root. This prevents us from extracting experimental or binary rules etc. which often are located in corresponding sub-directories. Reference: #12794. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 7223e6bea..2736363a5 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -533,6 +533,9 @@ sub extractruleset ($) { # Handle rules files. } elsif ($file =~ m/\.rules$/) { + # Skip rule files which are not located in the rules directory or archive root. + next unless(($packed_file =~ /^rules\//) || ($packed_file !~ /\//)); + my $rulesfilename; # Splitt the filename into chunks.