From: Stefan Schantl Date: Thu, 2 Dec 2021 06:43:00 +0000 (+0100) Subject: ids-functions.pl: Check if the generated stored rulesfile of a provider X-Git-Tag: v2.27-core164~210^2~21 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=577e3304953c708bce7f6c067bf34c3f585d3a0f 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 --- 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; }