From: Stefan Schantl Date: Sun, 4 Apr 2021 06:15:48 +0000 (+0200) Subject: Revert "ids-functions.pl: Remove config files on rulesdir cleanup." X-Git-Tag: v2.27-core164~210^2~54 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=52071c0e9e7956c2e1a42430c01f06a383c2787d 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. --- 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);