vsftpd issue

"gulikoza" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Hi,

r106 fixed scripts/services/vsftpd for RHEL/Centos 6 (PID issue), but it
seems as not all regexes were changed.
The first 3 matches have:

($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] OK
UPLOAD

The rest have:

($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\]
FAIL UPLOAD

Note parentheses in the first brackets.
With this log line:

Mon Aug 19 16:35:01 2013 [pid 15604] [user] OK DOWNLOAD: Client
"xx.xx.xx.xx", ...

pid ends in $User...

Patch attached.

Regards,
gulikoza

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

_______________________________________________
Logwatch-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
logwatch-vsftpd-pid.diff (application/octet-stream, 3.9 KB)
diff --git a/scripts/services/vsftpd b/scripts/services/vsftpd
--- a/scripts/services/vsftpd
+++ b/scripts/services/vsftpd
@@ -48,37 +48,37 @@ while (defined($ThisLine = <STDIN>)) {
       $Temp = "   " . $FileName . " <- " . $IP . " (User: " . $User . ")\n";
       $TotalBytesIn+= $FileSize;
       push @UploadedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] FAIL UPLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
+   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] FAIL UPLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
       $Temp = "   " . $FileName . " <- " . $IP . " (User: " . $User . ")\n";
       $TotalBytesIn+= $FileSize;
       push @FailedUploadedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] OK DOWNLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
+   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] OK DOWNLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
       $Temp = "   " . $FileName . " -> " . $IP . " (User: " . $User . ")\n";
       $TotalBytesOut+= $FileSize;
       push @DownloadedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] FAIL DOWNLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
+   } elsif ( ($User,$IP,$FileName,$FileSize) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] FAIL DOWNLOAD: Client \"(.*)\", \"(.*)\", (?:(\d+) bytes)?/ ) ) {
       $Temp = "   " . $FileName . " -> " . $IP . " (User: " . $User . ")\n";
       $TotalBytesOut+= $FileSize;
       push @FailedDownloadedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] OK DELETE: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] OK DELETE: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " >< " . $IP . " (User: " . $User . ")\n";
       $TotalDeleted++;
       push @DeletedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] FAIL DELETE: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] FAIL DELETE: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " <> " . $IP . " (User: " . $User . ")\n";
       push @FailedDeletedFiles,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] OK MKDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] OK MKDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " <- " . $IP . " (User: " . $User . ")\n";
       $TotalCreatedDirs++;
       push @CreatedDirs,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] FAIL MKDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] FAIL MKDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " xx " . $IP . " (User: " . $User . ")\n";
       push @FailedCreatedDirs,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] OK RMDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] OK RMDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " >< " . $IP . " (User: " . $User . ")\n";
       $TotalRemovedDirs++;
       push @RemovedDirs,$Temp;
-   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[(.*)\] )?\[(.*)\] FAIL RMDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
+   } elsif ( ($User,$IP,$FileName) = ( $ThisLine =~ /(?:\[.*\] )?\[(.*)\] FAIL RMDIR: Client \"(.*)\", \"(.*)\"/ ) ) {
       $Temp = "   " . $FileName . " <> " . $IP . " (User: " . $User . ")\n";
       push @FailedRemovedDirs,$Temp;
    } elsif ( ($Date, $IP,$FileSize,$FileName,$Direction,$AccessMode,$User) =
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.