25f594
Correctly apply time filter when parsing vsftpd log messages.
25f594
25f594
Author: Ivana Varekova <varekova@redhat.com>
25f594
RH-Bugzilla: #217226
25f594
25f594
--- logwatch-7.3.1/scripts/logwatch.pl.pom	2006-09-16 06:04:14.000000000 +0200
25f594
+++ logwatch-7.3.1/scripts/logwatch.pl	2006-11-29 13:16:22.000000000 +0100
25f594
@@ -917,11 +917,16 @@
25f594
    my $FilterText = " ";
25f594
    foreach (sort keys %{$LogFileData{$LogFile}}) {
25f594
       my $cmd = $_;
25f594
+      
25f594
       if ($cmd =~ s/^\d+-\*//) {
25f594
          if (-f "$ConfigDir/scripts/shared/$cmd") {
25f594
             $FilterText .= ("| $PerlVersion $ConfigDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" );
25f594
          } elsif (-f "$BaseDir/scripts/shared/$cmd") {
25f594
-            $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" );
25f594
+             if ($LogFile =~ /^vsftpd$/ ) {
25f594
+                 $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/applyvsftpddate '$LogFileData{$LogFile}{$_}'" );
25f594
+	     } else {
25f594
+                 $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" );      
25f594
+             }
25f594
          } else {
25f594
 	     die "Cannot find shared script $cmd\n";
25f594
          }
25f594
--- logwatch-7.3.1/scripts/shared/applyvsftpddate.pom	2006-11-29 13:13:28.000000000 +0100
25f594
+++ logwatch-7.3.1/scripts/shared/applyvsftpddate	2006-11-29 13:10:26.000000000 +0100
25f594
@@ -0,0 +1,34 @@
25f594
+##########################################################################
25f594
+# $Id: applystddate,v 1.18 2005/10/22 00:19:56 bjorn Exp $
25f594
+##########################################################################
25f594
+
25f594
+########################################################
25f594
+# This was written and is maintained by:
25f594
+#    Kirk Bauer <kirk@kaybee.org>
25f594
+#
25f594
+# Please send all comments, suggestions, bug reports,
25f594
+#    etc, to logwatch-devel@logwatch.org
25f594
+########################################################
25f594
+
25f594
+use Logwatch ':dates';
25f594
+
25f594
+my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
25f594
+
25f594
+$SearchDate = TimeFilter('%b %e %H:%M:%S 20%y');
25f594
+
25f594
+# The date might be "Dec 09", but it needs to be "Dec  9"...
25f594
+#$SearchDate =~ s/ 0/  /;
25f594
+# The format of  Fri Nov 29 20:59:09 2005 
25f594
+
25f594
+if ( $Debug > 5 ) {
25f594
+   print STDERR "DEBUG: Inside ApplyStdDate...\n";
25f594
+   print STDERR "DEBUG: Looking For: " . $SearchDate . "\n";
25f594
+}
25f594
+
25f594
+while (defined($ThisLine = <STDIN>)) {
25f594
+   if ($ThisLine =~ m/(Mon|Tue|Wed|Thu|Fri|Sat|Sun) $SearchDate/o) {
25f594
+      print "$ThisLine";
25f594
+   }
25f594
+}
25f594
+
25f594
+# vi: shiftwidth=3 syntax=perl tabstop=3 et