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>

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

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>
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>
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>
This issue is fixed in version 0.25. Thanks for your report. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.