# HG changeset patch # User Matti Hamalainen # Date 1252263756 -10800 # Node ID 075b2b626d174fcf479250e6ac824e18ec00a61d # Parent ca0fd7f3909b0520964de057ef44132508ed36dd Fix check for number of SCANFILEs and SCANFILE_ONCEs. diff -r ca0fd7f3909b -r 075b2b626d17 README --- a/README Mon Aug 31 11:58:05 2009 +0300 +++ b/README Sun Sep 06 22:02:36 2009 +0300 @@ -1,4 +1,4 @@ -Malicious Attack Livid Termination Filter daemon (maltfilter) v0.19.4 +Malicious Attack Livid Termination Filter daemon (maltfilter) v0.20.0 ===================================================================== Programmed by Matti 'ccr' Hämäläinen (C) Copyright 2009 Tecnic Software productions (TNSP) diff -r ca0fd7f3909b -r 075b2b626d17 maltfilter --- a/maltfilter Mon Aug 31 11:58:05 2009 +0300 +++ b/maltfilter Sun Sep 06 22:02:36 2009 +0300 @@ -13,7 +13,7 @@ use LWP::UserAgent; use IO::Seekable; -my $progversion = "0.19.4"; +my $progversion = "0.20.0"; my $progbanner = "Malicious Attack Livid Termination Filter daemon (maltfilter) v$progversion\n". "Programmed by Matti 'ccr' Hamalainen \n". @@ -340,7 +340,7 @@ if ($class ne "IPTABLES") { if ($reportmode) { my @tmp = reverse(@{$table->{$mip}{"reason"}{$class}{"msg"}}); - if ($#tmp > 5) { $#tmp = 5; } + if (scalar @tmp > 5) { $#tmp = 5; } foreach (@tmp) { $_ = htmlentities($_); } $msgs = join(" ".bb($m)."|".eb($m)." ", @tmp); } else { @@ -539,6 +539,7 @@ { return unless ($settings{"DRONEBL"} > 0); + # If suspended, bail out until it's time to retry if ($dronebl_suspend > 0) { $dronebl_suspend--; return; @@ -636,8 +637,12 @@ my ($mip, $mdate, $mtype) = @_; return unless ($settings{"DRONEBL"} > 0); + + # Check against noaction IPs return if check_hosts_array(\@noaction_ips, $mip); + # If we have the host/IP in "recent memory", and it has been submitted + # or queued already, do not requeue. if (defined($statlist{$mip}) && defined($statlist{$mip}{"dronebl"})) { return if ($statlist{$mip}{"dronebl"} > 0); } @@ -1229,9 +1234,9 @@ # Check if we have anything to do if ($reportmode) { - mdie("Nothing to do, no SCANFILE(s) or SCANFILE_ONCE(s) defined in configuration.\n") unless ($#scanfiles > 0 || $#scanfiles_once > 0); + mdie("Nothing to do, no SCANFILE(s) or SCANFILE_ONCE(s) defined in configuration.\n") unless (scalar @scanfiles > 0 || scalar @scanfiles_once > 0); } else { - mdie("Nothing to do, no SCANFILE(s) defined in configuration.\n") unless ($#scanfiles > 0); + mdie("Nothing to do, no SCANFILE(s) defined in configuration.\n") unless (scalar @scanfiles > 0); } # General settings