Hello,
I redirected your mail to the ticket tracking system in order to have
a public trace of the discussion.
jon.armitage@hepworthunited.co.uk via RT wrote:
Show quoted text> Si vous ne comprenez pas, j'essaierai de traduire en francais.
No problem, I understand enough English to maintain modules, discuss
on mailing lists and attend conferences :-)
But thanks to have thought about that, very appreciated.
Show quoted text> We use your module Sys::Syslog as part of our SpamAssassin
> installation on a Sun V210 running Solaris 10.
>
> When we recently upgraded to the latest release of Sys::Syslog, we
> began to get this message in the logs when SpamAssassin started:
>
> [ Oct 9 21:03:49 Executing start method ("/usr/local/bin/spamd --
> daemonize --username=exim --syslog-socket=inet") ]
> [9732] error: Can't locate Sys/Syslog/Win32.pm in @INC (@INC
> contains: /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris /usr/
> local/lib/perl5/site_perl/5.8.8 /
> usr/local/lib/perl5/5.8.8/i86pc-solaris /usr/local/lib/perl5/5.8.8 /
> usr/local/lib/perl5/site_perl) at (eval 11) line 2.
Is SpamAssassin actually running after displaying this message or
does it exit?
Show quoted text> This seems to be related to these lines in Syslog.pm:
>
> # use EventLog on Win32
> my $is_Win32 = $^O =~ /Win32/i;
> eval "use Sys::Syslog::Win32";
>
> If you comment out the eval line, the error disappears.
>
> I don't speak perl, but should it not say something like:
>
> # use EventLog on Win32
> my $is_Win32 = $^O;
> if (my $is_Win32 =~ /Win32/i) {
> eval "use Sys::Syslog::Win32";
> }
It would seem logical, but this code was done this way in order to
allow systems with the Win32 modules, others than Windows, to use the
eventlog mechanism. For example Cygwin.
Show quoted text> That said, this snippet does not error on my machine, whether I test
> for /Win32/ or /solaris/.
>
> Yours in puzzlement,
Yes. I can understand :-)
In my opinion, SpamAssassin is logging a false positive here. The
trick being that Sys::Syslog uses an eval() to find if the Win32 API
is available, and if it's the case, use the eventlog mechanism as the
default. But the $@ variable isn't reset. Looking (again) at the code
of SpamAssassin, I see it's full of eval(), and one of them is
probably seeing that $@ isn't empty, and therefore concludes that
there was an error.
The fix may therefore be simple: reset $@ after the eval()s in
Sys::Syslog in order to prevent false errors from leaking to
SpamAssassin. I just committed a patch to try addressing this problem:
»
http://svnweb.mongueurs.net/Sys-Syslog/revision/?rev=147
If you can test from the Subversion repository, can you try
SpamAssassin with the latest revision of Sys::Syslog? You can check
it out with the following command:
$ svn co svn://svn.mongueurs.net/Sys-Syslog
Don't hesitate to ask if you encounter a problem while installing
this version.
--
Sébastien Aperghis-Tramoni
Close the world, txEn eht nepO.