ids-functions.pl: Rework cleanup rulesdir logic
Commit Message
Never drop any of the statically included rulefiles instead of specify
them one by one.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
config/cfgroot/ids-functions.pl | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
@@ -1086,11 +1086,8 @@ sub _cleanup_rulesdir() {
# We only want files.
next unless (-f "$rulespath/$file");
- # Skip rules file for whitelisted hosts.
- next if ("$rulespath/$file" eq $whitelist_file);
-
- # Skip rules file with local rules.
- next if ("$rulespath/$file" eq $local_rules_file);
+ # Skip any files which are part of the array of statically included rulefiles.
+ next if (grep(/$file/, @static_included_rulefiles));
# Delete the current processed file, if not, exit this function
# and return an error message.