ids-functions.pl: Do not delete the whitelist file on rulesdir cleanup.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 24 May 2019 15:45:33 +0000 (17:45 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 26 May 2019 14:09:21 +0000 (16:09 +0200)
Fixes #12087.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/cfgroot/ids-functions.pl

index 5530da1..88734a3 100644 (file)
@@ -572,6 +572,9 @@ sub _cleanup_rulesdir() {
                # 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);
+
                # Delete the current processed file, if not, exit this function
                # and return an error message.
                unlink("$rulespath/$file") or return "Could not delete $rulespath/$file. $!\n";