ids-functions.pl: Do not delete the whitelist file onrulesdir cleanup.

Message ID 20190524154533.4697-1-stefan.schantl@ipfire.org
State Accepted
Commit fefb5173cf02c6b94f2f199bb342df550752ade0
Headers
Series ids-functions.pl: Do not delete the whitelist file onrulesdir cleanup. |

Commit Message

Stefan Schantl May 25, 2019, 1:45 a.m. UTC
  Fixes #12087.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/cfgroot/ids-functions.pl | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl
index deb287bb7..a52440f35 100644
--- a/config/cfgroot/ids-functions.pl
+++ b/config/cfgroot/ids-functions.pl
@@ -582,6 +582,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";