mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Fix Fail2Ban version detection
https://forum.virtualmin.com/t/fail2ban-intrusion-detector-firewalld-default-jail-options/133201/11?u=ilia
This commit is contained in:
@ -19,9 +19,10 @@ print &ui_form_start("save_config.cgi", "post");
|
||||
print &ui_table_start($text{'config_header'}, undef, 2);
|
||||
|
||||
# Logging level
|
||||
my $loglevel = &find_value("loglevel", $def) || 3;
|
||||
my $logsymbsupp = &compare_version_numbers(&get_fail2ban_version(), "0.9") >= 0;
|
||||
my $loglevel = &find_value("loglevel", $def) || ($logsymbsupp ? "INFO" : 3);
|
||||
my @loglevels;
|
||||
if (&compare_version_numbers(&get_fail2ban_version(), "0.9") >= 0) {
|
||||
if ($logsymbsupp) {
|
||||
@loglevels = ( "CRITICAL", "ERROR", "WARNING",
|
||||
"NOTICE", "INFO", "DEBUG" );
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ foreach my $f (reverse(@all_files_for_lock)) {
|
||||
sub get_fail2ban_version
|
||||
{
|
||||
my $out = &backquote_command("$config{'client_cmd'} -V 2>/dev/null </dev/null");
|
||||
return !$? && $out =~ /v([0-9\.]+)/ ? $1 : undef;
|
||||
return !$? && $out =~ /v?([0-9\.]+)/ ? $1 : undef;
|
||||
}
|
||||
|
||||
# Unblock given IP in given jail
|
||||
|
Reference in New Issue
Block a user