ids-functions.pl: Rework cleanup rulesdir logic

Message ID 20261005183617.4431-1-stefan.schantl@ipfire.org
State New
Headers
Series ids-functions.pl: Rework cleanup rulesdir logic |

Commit Message

Stefan Schantl 5 Oct 2026, 6:36 p.m. UTC
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(-)
  

Patch

diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl
index 93d1acdee..4c03926d7 100644
--- a/config/cfgroot/ids-functions.pl
+++ b/config/cfgroot/ids-functions.pl
@@ -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.