[Logwatch-Devel] CVS update logwatch.pl please test

Mike Tremaine mgt at stellarcore.net
Sun Jan 8 16:26:28 MST 2006


On Sun, 2006-01-08 at 21:21 +0100, Markus Lude wrote:
> On Wed, Jan 04, 2006 at 10:01:46AM -0800, Mike Tremaine wrote:
> > 
> > I just committed the HTML and MIME::Base64 patches to logwatch.pl this
> > was pretty large re-write and it needs both testing and a few cleanups
> > but I wanted to get the majority of it out now. So for those braves
> > souls out there please give it a test.
> > 
> > 
> > Changes...
> 
> # ./logwatch_test.pl --mailto lude
> works well, but the following not
> 
> # ./logwatch_test.pl --mailto lude --service kernel
> print() on unopened filehandle OUTFILE at /pathto/logwatch_test.pl line 1169.
> print() on unopened filehandle OUTFILE at /pathto/logwatch_test.pl line 1179.
> print() on unopened filehandle OUTFILE at /pathto/logwatch_test.pl line 1180.
> print() on unopened filehandle OUTFILE at /pathto/logwatch_test.pl line 1185.
> 

I committed a fix to CVS... Basically if ther ewas no output then
initprint() is never called, which means OUTFILE is never opened. Since
I was lazy and just assumed printing empty strings was ok. ;) KABOOM....

Here is the simple fix.


[mgt at dwarfstar scripts]$ cvs diff logwatch.pl
Index: logwatch.pl
===================================================================
RCS file: /var/cvs/logwatch/scripts/logwatch.pl,v
retrieving revision 1.152
diff -r1.152 logwatch.pl
1169c1169
<    print OUTFILE $out_mime;
---
>    print OUTFILE $out_mime if $out_mime;
1171,1172c1171,1172
<       print OUTFILE encode_base64($out_head);
<       print OUTFILE encode_base64($out_reference);
---
>       print OUTFILE encode_base64($out_head) if $out_head;
>       print OUTFILE encode_base64($out_reference) if $out_reference;
1177c1177
<       print OUTFILE encode_base64($out_foot);
---
>       print OUTFILE encode_base64($out_foot) if $out_foot;
1179,1180c1179,1180
<       print OUTFILE $out_head;
<       print OUTFILE $out_reference;
---
>       print OUTFILE $out_head if $out_head;
>       print OUTFILE $out_reference if $out_reference;
1185c1185
<       print OUTFILE $out_foot;
---
>       print OUTFILE $out_foot if $out_foot;





More information about the Logwatch-Devel mailing list