changeset 103:df68cf1eaf39

Merged?
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 06 Sep 2009 22:07:22 +0300
parents 8835840a51ab (diff) 1cbefe9c26c1 (current diff)
children f24388499e66
files maltfilter
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Sep 01 18:48:47 2009 +0300
+++ b/.hgtags	Sun Sep 06 22:07:22 2009 +0300
@@ -19,3 +19,4 @@
 55670dabda5a4dddf4d7c02ca025f72037dd754d maltfilter-0.19.2
 b1f9df8bb0843e00d26c0fe79454f0ad2b83c4e7 maltfilter-0.19.3
 53a076bc75db2bda72f20cec629876e8c3da0cbf maltfilter-0.19.4
+075b2b626d174fcf479250e6ac824e18ec00a61d maltfilter-0.20.0
--- a/README	Tue Sep 01 18:48:47 2009 +0300
+++ b/README	Sun Sep 06 22:07:22 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 <ccr@tnsp.org>
 (C) Copyright 2009 Tecnic Software productions (TNSP)
--- a/maltfilter	Tue Sep 01 18:48:47 2009 +0300
+++ b/maltfilter	Sun Sep 06 22:07:22 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 <ccr\@tnsp.org>\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