]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Revert "ids-functions.pl: Remove config files on rulesdir cleanup."
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 4 Apr 2021 06:15:48 +0000 (08:15 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 19 Dec 2021 12:23:43 +0000 (13:23 +0100)
Not all config files are shipped by the rulesets. For example the
"threshold.conf" and the "referneces.conf" are not include in each
ruleset.

Therefore it is not a common way to delete all config files. It is
much safer to simple keep them and overwrite existing ones by the
generated ones.

This reverts commit a71c3c9dcc60541aa4504d0f1fb0a78c0d58ed5e.

config/cfgroot/ids-functions.pl

index f4f06413c06a83ac3b24f0f7003660f0db086521..c231e0d444772216cf138939effd2d2a95c46758 100644 (file)
@@ -1094,6 +1094,9 @@ sub _cleanup_rulesdir() {
                # We only want files.
                next unless (-f "$rulespath/$file");
 
+               # Skip element if it has config as file extension.
+               next if ($file =~ m/\.config$/);
+
                # Skip rules file for whitelisted hosts.
                next if ("$rulespath/$file" eq $whitelist_file);