Blame SOURCES/logwatch-vsftpd.patch

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