]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids.cgi: Use tarball information from ids-functions.pl
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 14 Feb 2018 09:15:39 +0000 (10:15 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 26 Jul 2018 09:57:23 +0000 (11:57 +0200)
Directly use the value from the ids-functions.pl for the
location and filename of the tarball which includes the snort ruleset.

This will save to declare this information twice and prevents from any
failures if the location of filname every changes.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index 2f7ea23eb155d808d9b2317181423a81b4c649e6..8ae4da774964a1fdc82163f7316c6b860a010d57 100644 (file)
@@ -47,7 +47,6 @@ my %selected=();
 # Get netsettings.
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
 
-my $rulestarball = "/var/tmp/snortrules.tar.gz";
 my $snortrulepath = "/etc/snort/rules";
 my $snortusedrulefilesfile = "${General::swroot}/snort/snort-used-rulefiles.conf";
 my $errormessage;
@@ -345,9 +344,9 @@ if ($errormessage) {
 my $rulesdate;
 
 # Check if a ruleset allready has been downloaded.
-if ( -f "$rulestarball"){
+if ( -f "$IDS::rulestarball"){
        # Call stat on the filename to obtain detailed information.
-        my @Info = stat("$rulestarball");
+        my @Info = stat("$IDS::rulestarball");
 
        # Grab details about the creation time.
         $rulesdate = localtime($Info[9]);