Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 35952
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: Nobody in particular
Requestors: matt.gramlich [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.25



Subject: bug: 'nofatal' option turns on all (or most) options.
Date: Fri, 16 May 2008 14:11:39 -0500
To: bug-Sys-Syslog [...] rt.cpan.org
From: "Matt Gramlich" <matt.gramlich [...] gmail.com>
Download Syslog.pm.patch
text/x-diff 47b

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 654b
Attached is a patch for Sys-Syslog-0.24 perl version: 5.8.2 operating system: Fedora Core 2 (it will affect most [if not all] versions of Perl and Linux) The problem it fixes is one where passing 'nofatal' as an option to openlog ends up turning on all of the options. The problem lies in xlate() not seeing a LOG_NOFATAL and thus returning -1 which then gets passed on to C's syslog as a collection of bits with most of them enabled. Creating the constant LOG_NOFATAL at least gives xlate() something to find. The symptoms that I saw and then saw fixed were that all syslog traffic was also being printed to STDERR, eventhough I did NOT pass perror.
Subject: Re: [rt.cpan.org #35952] bug: 'nofatal' option turns on all (or most) options.
Date: Fri, 16 May 2008 23:29:29 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 1.2k
Hello, Matt Gramlich wrote: Show quoted text
> The problem it fixes is one where passing 'nofatal' as an option to > openlog > ends up turning on all of the options. The problem lies in xlate() not > seeing a LOG_NOFATAL and thus returning -1 which then gets passed > on to C's > syslog as a collection of bits with most of them enabled. Creating the > constant LOG_NOFATAL at least gives xlate() something to find.
Good catch. The problem only appears when using the native mechanism, which should usually be the case given it's the default one since version 0.16. Except countless programs have a setlogsock("unix") call. The problem is that connect_native() even see the nofatal option, so a better fix is probably: --- Syslog.pm (revision 218) +++ Syslog.pm (working copy) @@ -171,7 +171,7 @@ $options{$opt} = 1 if exists $options{$opt} } - $err_sub = $options{nofatal} ? \&warnings::warnif : \&croak; + $err_sub = delete $options{nofatal} ? \&warnings::warnif : \&croak; return 1 unless $options{ndelay}; connect_log(); } but the real problem is that there should have been a test case for this option, so I'll first write one before commiting the fix. Thanks for reporting this bug. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #35952] bug: 'nofatal' option turns on all (or most) options.
Date: Sat, 17 May 2008 00:34:34 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 324b
Show quoted text
> but the real problem is that there should have been a test case for > this option, so I'll first write one before commiting the fix.
Unfortunately, it's extremely hard to test given it depends on external conditions, so I'll just commit the fix. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #35952] bug: 'nofatal' option turns on all (or most) options.
Date: Sun, 8 Jun 2008 03:09:57 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
Download (untitled) / with headers
text/plain 130b
This issue is fixed in version 0.25. Thanks for your report. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.