mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-15 21:43:00 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user