]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
ids-functions.pl: Extract rules files if they are in a providers rules folder.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 7 Mar 2023 12:38:09 +0000 (13:38 +0100)
committerPeter Müller <peter.mueller@ipfire.org>
Sat, 11 Mar 2023 16:26:15 +0000 (16:26 +0000)
Now the rules files in a subfolder like "<provider>-rules" also will get
extracted.

Fixes rule file extraction for Snort Community ruleset.

Fixes #12948.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
config/cfgroot/ids-functions.pl

index ec4fdacc57680c3deb75a759de0e1c29bae1a1eb..d97431b4a3dd82c45f93b007c0e5b24784e31296 100644 (file)
@@ -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.
                                #