mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-11 19:55:52 +02:00
ids-functions.pl: Do not use a hard-code temporary download location.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -130,6 +130,9 @@ my $suricatactrl = "/usr/local/bin/suricatactrl";
|
||||
# Prefix for each downloaded ruleset.
|
||||
my $dl_rulesfile_prefix = "idsrules";
|
||||
|
||||
# Temporary directory to download the rules files.
|
||||
my $tmp_dl_directory = "/var/tmp";
|
||||
|
||||
# Temporary directory where the rulesets will be extracted.
|
||||
my $tmp_directory = "/tmp/ids_tmp";
|
||||
|
||||
@@ -371,9 +374,9 @@ sub downloadruleset ($) {
|
||||
# Pass the requested URL to the downloader.
|
||||
my $request = HTTP::Request->new(GET => $url);
|
||||
|
||||
# Generate temporary file name, located in "/var/tmp" and with a suffix of ".tmp".
|
||||
# Generate temporary file name, located in the tempoary download directory and with a suffix of ".tmp".
|
||||
# The downloaded file will be stored there until some sanity checks are performed.
|
||||
my $tmp = File::Temp->new( SUFFIX => ".tmp", DIR => "/var/tmp/", UNLINK => 0 );
|
||||
my $tmp = File::Temp->new( SUFFIX => ".tmp", DIR => "$tmp_dl_directory/", UNLINK => 0 );
|
||||
my $tmpfile = $tmp->filename();
|
||||
|
||||
# Call function to get the final path and filename for the downloaded file.
|
||||
|
||||
Reference in New Issue
Block a user