ids.cgi: Fix check and message when trying to enable suricata without

any enabled or no provider.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2021-04-01 15:09:59 +02:00
parent 106f00bdbb
commit 4b6cf2a54a
3 changed files with 7 additions and 4 deletions

View File

@@ -530,9 +530,12 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
# Check if the IDS should be enabled.
if ($cgiparams{'ENABLE_IDS'} eq "on") {
# Get enabled providers.
my @enabled_providers = &IDS::get_enabled_providers();
# Check if any ruleset is available. Otherwise abort and display an error.
unless(%used_providers) {
$errormessage = $Lang::tr{'ids no ruleset available'};
unless(@enabled_providers) {
$errormessage = $Lang::tr{'ids no enabled ruleset provider'};
}
# Loop through the array of available interfaces.