On Mon, Sep 27, 2010 at 03:06:42PM +0100, Paul wrote:
Usage: Unix::Syslog::LOG_FAC(p) at (eval 119) line 1.
This is happening because LOG_FAC() expects a parameter, but we're not giving it one. The problem doesn't happen everywhere, as LOG_FAC isn't on all platforms.
The fix is relatively simple -- MIMEDefang needs to ignore those macros, since all we really want are the LOG_* constants, not the unfortunately-named LOG_* macros that we get on some platforms.
I've attached a patch, and would appreciate it if those of you encountering the problem could test it for me.
Cheers, Dave -- Dave O'Neill <[email protected]> Roaring Penguin Software Inc. +1 (613) 231-6599 http://www.roaringpenguin.com/ For CanIt technical support, please mail: [email protected]
>From cfb99f134c5a39ee2bc92e133fcc0f6a6f5bb57c Mon Sep 17 00:00:00 2001 From: Dave O'Neill <[email protected]> Date: Wed, 29 Sep 2010 14:18:02 -0400 Subject: [PATCH] Bugfix: Avoid non-constant LOG_* macros from Unix::Syslog This addresses an issue where _make_fac_map can throw errors like: Usage: Unix::Syslog::LOG_FAC(p) at (eval 119) line 1. when trying to use macros that take arguments as constant macros. This is also now fixed in Log::Syslog::Abstract -- which we would be using here if we didn't want to avoid forcing MIMEDefang users to fetch another CPAN dependency :( --- mimedefang.pl.in | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/mimedefang.pl.in b/mimedefang.pl.in index 91af076..4ac7b45 100755 --- a/mimedefang.pl.in +++ b/mimedefang.pl.in @@ -695,6 +695,16 @@ sub time_str () { error => 'err', panic => 'emerg', ); + + # Some of the Unix::Syslog 'macros' tag exports aren't + # constants, so we need to ignore them if found. + my %blacklisted = map { $_ => 1 } qw( + LOG_MASK + LOG_UPTO + LOG_PRI + LOG_MAKEPRI + LOG_FAC + ); sub _make_fac_map { my %map; @@ -702,7 +712,7 @@ sub time_str () { # Ugh. Make sure we map only the available constants # on this platform. Some are not defined properly on # all platforms. - foreach my $constant ( @{ $Unix::Syslog::EXPORT_TAGS{macros} } ) { + foreach my $constant ( grep { /^LOG_/ && !exists $blacklisted{$_} } @{ $Unix::Syslog::EXPORT_TAGS{macros}} ) { my $name = lc $constant; $name =~ s/^log_//; -- 1.6.5
_______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

