From: Stefan Schantl Date: Tue, 13 Apr 2021 16:56:49 +0000 (+0200) Subject: ids.cgi: Fix check when changing the IDS to monitor mode or drop mode. X-Git-Tag: v2.27-core164~210^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=724f98c086a165e7528d0780cb8afe9e95421e93;p=ipfire-2.x.git ids.cgi: Fix check when changing the IDS to monitor mode or drop mode. The test condition was wrong here and therefore oinkmaster never has been executed when this setting has been changed. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 1f8e09a6c8..77293c0201 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -603,15 +603,15 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) { # Read-in current (old) IDS settings. &General::readhash("$IDS::ids_settings_file", \%oldidssettings); + # Get enabled providers. + my @enabled_providers = &IDS::get_enabled_providers(); + # Prevent form name from been stored in conf file. delete $cgiparams{'IDS'}; # 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. + # Check if at least one provider is enabled. Otherwise abort and display an error. unless(@enabled_providers) { $errormessage = $Lang::tr{'ids no enabled ruleset provider'}; } @@ -660,8 +660,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) { # Check if "MONITOR_TRAFFIC_ONLY" has been changed. if($cgiparams{'MONITOR_TRAFFIC_ONLY'} ne $oldidssettings{'MONITOR_TRAFFIC_ONLY'}) { - # Check if a ruleset exists. - if (%used_providers) { + # Check if at least one provider is enabled. + if (@enabled_providers) { # Lock the webpage and print message. &working_notice("$Lang::tr{'ids working'}");