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 <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2021-12-02 07:43:00 +01:00
parent 27671216d5
commit 577e330495

View File

@@ -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;
}