Bug#428183: [Fwd: Bug#428183: logwatch errors need full arguments]
Willi Mann <[email protected]>
| Newsgroups | gmane.linux.debian.devel.bugs.general,gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi! Here is a bug report I received today. I hope that the patch by the reporter is useful. Willi -------- Original-Nachricht -------- Betreff: Bug#428183: logwatch errors need full arguments Weitersenden-Datum: Sat, 09 Jun 2007 16:54:01 +0000, Sat, 09 Jun 2007 16:54:05 +0000 Weitersenden-Von: Kees Cook <[email protected]> Weitersenden-An: [email protected] Weitersenden-CC: Willi Mann <[email protected]> Datum: Sat, 9 Jun 2007 09:48:28 -0700 Von: Kees Cook <[email protected]> Antwort an: Kees Cook <[email protected]>, [email protected] Organisation: Outflux An: Debian Bugs <[email protected]> Package: logwatch Version: 7.3.1-5 Severity: normal Tags: patch When logwatch fails to decompress a log file, there is no indication of which file caused the problem. Errors currently look like this: /etc/cron.daily/00logwatch: zcat: stdout: No space left on device system zcat failed: 256 at /usr/sbin/logwatch line 878. run-parts: /etc/cron.daily/00logwatch exited with return code 25 The attached patch adds the command arguments to the decompression error messages (as is already done for some of the other system() calls). Thanks! -- Kees Cook @outflux.net
logwatch-errors.patch
(text/x-diff, 2.1 KB)
diff -u logwatch-7.3.6/scripts/logwatch.pl logwatch-7.3.6/scripts/logwatch.pl
--- logwatch-7.3.6/scripts/logwatch.pl
+++ logwatch-7.3.6/scripts/logwatch.pl
@@ -876,18 +876,18 @@
#For each filter to apply -mgt
my $arguments = "$Archive >> $DestFile";
system("$Config{'pathtozcat'} $arguments") == 0
- or die "system $Config{'pathtozcat'} failed: $?"
+ or die "system '$Config{'pathtozcat'} $arguments' failed: $?"
} elsif (($Archive =~ m/bz2$/) && (-f "$Archive")) {
#These system calls are not secure but we are getting closer
#What needs to go is all the pipes and instead we need a command loop
#For each filter to apply -mgt
my $arguments = "$Archive 2>/dev/null >> $DestFile";
system("$Config{'pathtobzcat'} $arguments") == 0
- or die "system $Config{'pathtobzcat'} failed: $?"
+ or die "system '$Config{'pathtobzcat'} $arguments' failed: $?"
} elsif (-f "$Archive") {
my $arguments = "$Archive >> $DestFile";
system("$Config{'pathtocat'} $arguments") == 0
- or die "system $Config{'pathtocat'} failed: $?"
+ or die "system '$Config{'pathtocat'} $arguments' failed: $?"
} #End if/elsif existence
} #End if $CheckTime
@@ -965,7 +965,7 @@
#What needs to go is all the pipes and instead we need a command loop
#For each filter to apply -mgt
system("$Config{'pathtocat'} $Command") == 0
- or die "system $Config{'pathtocat'} $Command failed: $?"
+ or die "system '$Config{'pathtocat'} $Command' failed: $?"
}
}
}
@@ -983,7 +983,7 @@
my $eeefile = ("$TempDir" . "$newlogfile");
if ((!(-d $eeefile)) && (!($eeefile =~ m/-archive/))) {
system("$Config{'pathtocat'} $eeefile $ecpcmd") == 0
- or die "system $Config{'pathtocat'} $eeefile $ecpcmd failed: $?"
+ or die "system '$Config{'pathtocat'} $eeefile $ecpcmd' failed: $?"
}
}
#read in the final host list