hi Sébastien,
The problem is not really in your code. Here is the released
Net::Server 0.94 code:
my $opt = defined($prop->{syslog_logopt})
? $prop->{syslog_logopt} : $Sys::Syslog::VERSION ge '0.15' ?
'pid,nofatal' : 'pid';
$prop->{syslog_logopt} = ($opt =~ /^((cons|ndelay|nowait|pid)($|\|))*/)
? $1 : 'pid';
...
if( ! Sys::Syslog::openlog($prop->{syslog_ident},
$prop->{syslog_logopt},
$prop->{syslog_facility}) ){
this produces an unitialized variable diagnostic when run in -w mode since
$prop->{syslog_logopt} is undef. I think the correct code is:
my $opt = defined($prop->{syslog_logopt})
? $prop->{syslog_logopt} : $Sys::Syslog::VERSION ge '0.15' ?
'pid|nofatal' : 'pid';
$prop->{syslog_logopt} = ($opt =~
/^((cons|ndelay|nowait|pid|nofatal)($|\|))*/)
? $1 : 'pid';
the unreleased change to openlog to do this:
$logopt ||='';
shuts up the warning, but the log option [pid,nofatal] that Net::Server
intends are probably
not being set by default then.
in any case, running unmodified postgrey 1.27 with the 0.94 version of
Net::Server
coughs up a warning which could be eliminated by changes to postgrey (set
syslog_logopt there), Net::Server::Server.pm, or Sys::Syslog, but the
right place
for the fix appears to be Net::Server.
phil
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=23882 >
>
> Phil Hooper wrote via RT:
>
>
>> hi,
>>
>> the problem is coming from a change in Net::Server/Server.pm to add
>> "nofatal" to default log options
>>
>> bug 21265 has what looks like an incomplete solution in diff form. I'll
>> send some info to that module's author. If you want to pass on to the guy
>> who had the problem,
>> he'll want to edit .../lib/perl5/site_perl/*/Net/Server.pm and:
>> 1] change 'pid,nofatal' to 'pid|nofatal' at line 263
>>
>
> No need for such change: Sys::Syslog has always searched for its options
> as just being separated by word boundaries, so comma is as good as pipe.
>
>
>> 2] add |nofatal to the list of strings in line 264
>>
>
> Also note that passing options that were unknown to previous versions of
> Sys::Syslog should not cause errors or even warnings when running with
> those old versions, given the way options were detected.
>
> --
> Sébastien Aperghis-Tramoni
>
> Close the world, txEn eht nepO.
>
>