ids-functions.pl: Early abort downloadruleset() if no ruleset is configured

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2018-08-27 15:11:28 +02:00
parent e568796bb0
commit be52c68a2d

View 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);