From a0df7aa683e4e288c2050ab883b3586b6e447a00 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 4 Apr 2021 08:15:48 +0200 Subject: [PATCH] Revert "ids-functions.pl: Remove config files on rulesdir cleanup." 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index f4f06413c0..c231e0d444 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -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); -- 2.39.5