]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids-functions.pl: Early abort downloadruleset() if no ruleset is configured
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 27 Aug 2018 13:11:28 +0000 (15:11 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 27 Aug 2018 13:11:28 +0000 (15:11 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/ids-functions.pl

index 28f08182aff999190c9ceef9fda83db730753a76..a514d79893cc7029c7213798d490fb9840e52e0d 100644 (file)
@@ -98,6 +98,15 @@ sub downloadruleset {
        my %snortsettings=();
        &General::readhash("$settingsdir/settings", \%snortsettings);
 
+       # Check if a ruleset has been configured.
+       unless($snortsettings{'RULES'}) {
+               # Log that no ruleset has been configured and abort.
+               &_log_to_syslog("No ruleset source has been configured.");
+
+               # Return "1".
+               return 1;
+       }
+
        # Get all available ruleset locations.
        my %rulesetsources=();
        &General::readhash($rulesetsourcesfile, \%rulesetsources);