]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
ids-functions.pl: Do not longer extract all rulefiles in archive.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 13 Mar 2022 19:27:25 +0000 (20:27 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Mar 2022 15:55:40 +0000 (15:55 +0000)
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 <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/ids-functions.pl

index 468efc668f43cb9fac8d69e0c42500f4c118de51..c4edd968d05f9572bf9a99c62ab6f7e710b93dd2 100644 (file)
@@ -544,6 +544,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.