From 577e3304953c708bce7f6c067bf34c3f585d3a0f Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 2 Dec 2021 07:43:00 +0100 Subject: [PATCH] ids-functions.pl: Check if the generated stored rulesfile of a provider exists before returning the filename. This will prevent from using and processing non existing files. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 64d98a3882..8c2d6782f5 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -861,6 +861,12 @@ sub _get_dl_rulesfile($) { # Generate the full filename and path for the stored rules file. my $rulesfile = "$dl_rules_path/$dl_rulesfile_prefix-$provider$suffix"; + # Check if the file exists. + unless (-f "$rulesfile") { + # Abort return - nothing. + return; + } + # Return the generated filename. return $rulesfile; } -- 2.39.5