From 2032e7eecc282fa341596fed6bb9c53fffe4c802 Mon Sep 17 00:00:00 2001 From: Packit Bot Date: May 08 2021 08:12:35 +0000 Subject: Apply patch logwatch-vsftpd.patch patch_name: logwatch-vsftpd.patch present_in_specfile: true --- diff --git a/scripts/logwatch.pl b/scripts/logwatch.pl index 6fcb5cb..e704a66 100755 --- a/scripts/logwatch.pl +++ b/scripts/logwatch.pl @@ -805,11 +805,16 @@ foreach $LogFile (@LogFileList) { my $FilterText = " "; foreach (sort keys %{$LogFileData{$LogFile}}) { my $cmd = $_; + if ($cmd =~ s/^\d+-\*//) { if (-f "$ConfigDir/scripts/shared/$cmd") { $FilterText .= ("| $PerlVersion $ConfigDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" ); } elsif (-f "$BaseDir/scripts/shared/$cmd") { - $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" ); + if ($LogFile =~ /^vsftpd$/ ) { + $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/applyvsftpddate '$LogFileData{$LogFile}{$_}'" ); + } else { + $FilterText .= ("| $PerlVersion $BaseDir/scripts/shared/$cmd '$LogFileData{$LogFile}{$_}'" ); + } } else { die "Cannot find shared script $cmd\n"; } diff --git a/scripts/shared/applyvsftpddate b/scripts/shared/applyvsftpddate new file mode 100644 index 0000000..0046d0e --- /dev/null +++ b/scripts/shared/applyvsftpddate @@ -0,0 +1,34 @@ +########################################################################## +# $Id: applystddate,v 1.18 2005/10/22 00:19:56 bjorn Exp $ +########################################################################## + +######################################################## +# This was written and is maintained by: +# Kirk Bauer +# +# Please send all comments, suggestions, bug reports, +# etc, to logwatch-devel@logwatch.org +######################################################## + +use Logwatch ':dates'; + +my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0; + +$SearchDate = TimeFilter('%b %e %H:%M:%S 20%y'); + +# The date might be "Dec 09", but it needs to be "Dec 9"... +#$SearchDate =~ s/ 0/ /; +# The format of Fri Nov 29 20:59:09 2005 + +if ( $Debug > 5 ) { + print STDERR "DEBUG: Inside ApplyStdDate...\n"; + print STDERR "DEBUG: Looking For: " . $SearchDate . "\n"; +} + +while (defined($ThisLine = )) { + if ($ThisLine =~ m/(Mon|Tue|Wed|Thu|Fri|Sat|Sun) $SearchDate/o) { + print "$ThisLine"; + } +} + +# vi: shiftwidth=3 syntax=perl tabstop=3 et