Correctly handle single IP in IgnoreIP prop

tags/0.1.5_el5 0.1.5_el5
Daniel Berteaud 11 years ago
parent fd3c7ae78a
commit fbd9cab08a
  1. 4
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/05IgnoreIP

@ -25,7 +25,9 @@ unless (($fail2ban{FilterLocalNetworks} || 'disabled') eq 'enabled'){
# Add a local whitelist # Add a local whitelist
foreach (split /[,;]/, ($fail2ban{'IgnoreIP'} || '')){ foreach (split /[,;]/, ($fail2ban{'IgnoreIP'} || '')){
my ($ip,$bits) = Net::IPv4Addr::ipv4_parse("$_"); my $addr = $_;
$addr .= '/32' unless ($addr =~ m/\/\d{1,2}$/);
my ($ip,$bits) = Net::IPv4Addr::ipv4_parse("$addr");
push @ip, "$ip/$bits"; push @ip, "$ip/$bits";
} }

Loading…
Cancel
Save