From patchwork Tue Mar 7 12:38:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6673 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 4PWFNV3NPXz3ww4 for ; Tue, 7 Mar 2023 12:38:18 +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 4PWFNS2krSzYq; Tue, 7 Mar 2023 12:38:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PWFNS1kcmz2yPS; Tue, 7 Mar 2023 12:38:16 +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 4PWFNR1N4nz2xNS for ; Tue, 7 Mar 2023 12:38:15 +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 4PWFNQ2TQdzKQ; Tue, 7 Mar 2023 12:38:14 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1678192694; 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=9Ok5juE/vHMH63DDo7Qo3g/iDJRQZfKrZz0PzID3uiE=; b=RzWzQyfISI+LabIDT8Tt0MymmnyOIEgmA1RZmbmO4VOMOxC5FdkmNvqU6bqs0Jmb2vuvJ1 XVJ5lJfkJA6iwDAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1678192694; 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=9Ok5juE/vHMH63DDo7Qo3g/iDJRQZfKrZz0PzID3uiE=; b=fVHKfU08UTTKcVlhgjhvwE79pCYWafuKpvebc8WFigpEj21X0JVR2VcjYrTg00kuOSVEfR Z+7twq9y1/zDyfDFT/lv369AXdN/0Yz80o6qStTiRkat1BTZ0HCpIhDPcZWrUEhlK5kSDK bTRlprdDy4oL6jGG553aaBmm62qjp7jSzrHuwT73Ru20ey7iLaVGgwna7Jq20/K+FMQNcw b2X4KBUAWR1Z1aCdySnADKGGsaJaaIGdR3Vqu+BOoOxt1LuZazBBd9XJhGJvVxHNIIaB4+ IAM2wFEFJLNeHhKH84+veN5SElZonFmX9aHStkwjH4iY6JOdwq1PH94WEt26eg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] ids-functions.pl: Extract rules files if they are in a providers rules folder. Date: Tue, 7 Mar 2023 13:38:09 +0100 Message-Id: <20230307123809.8181-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" Now the rules files in a subfolder like "-rules" also will get extracted. Fixes rule file extraction for Snort Community ruleset. Fixes #12948. Signed-off-by: Stefan Schantl Reviewed-by: Adolf Belka --- config/cfgroot/ids-functions.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index ec4fdacc5..d97431b4a 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -572,7 +572,7 @@ 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 !~ /\//)); + next unless(($packed_file =~ /^rules\//) || ($packed_file =~ /^$provider-rules\//) || ($packed_file !~ /\//)); # Skip deleted.rules. #