Subject: | FW: Bug in Net::Syslog V0.04 |
Date: | Thu, 25 Feb 2016 23:49:56 +0000 |
To: | "'bug-Net-Syslog [...] rt.cpan.org'" <bug-Net-Syslog [...] rt.cpan.org> |
From: | "Sorrell, Al" <Al_Sorrell [...] troweprice.com> |
Author email address below is dead
Show quoted text
_____________________________________________
From: Sorrell, Al
Sent: Thursday, February 25, 2016 4:47 PM
To: 'les@lesandchris.com'
Subject: Bug in Net::Syslog V0.04
Les,
Thanks for this module!
I believe I've uncovered an error in this module Version=0.04
If the Priority is set to 'emerg' or 'emergency' (which evaluates to 0 in %syslog_priorities), then at line 97:
my $priority_i = $syslog_priorities{ $local{Priority} } || 3;
ends up evaluating as
my $priority_i = 0 ||3 which gives a result of 3 rather than 0 which is the desired result
I believe you'll have the same problem with Facility set to 'kern' which has the value of 0 and has a similar test at line 96
my $facility_i = $syslog_facilities{ $local{Facility} } || 21;
I believe you need something like:
my $facility_i=21;
$facility_i=$syslog_facilities{ $local{Facility} } if(exists $syslog_facilities{ $local{Facility} });
my $priority_i=3;
$priority_i=$syslog_priorities{ $local{Priority} } if(exists $syslog_priorities{ $local{Priority} });
Email: Al_Sorrell@troweprice.com<mailto:Al_Sorrell@troweprice.com>
T. Rowe Price (including T. Rowe Price Group, Inc. and its affiliates) and its associates do not provide legal or tax advice. Any tax-related discussion contained in this e-mail, including any attachments, is not intended or written to be used, and cannot be used, for the purpose of (i) avoiding any tax penalties or (ii) promoting, marketing, or recommending to any other party any transaction or matter addressed herein. Please consult your independent legal counsel and/or professional tax advisor regarding any legal or tax issues raised in this e-mail.
The contents of this e-mail and any attachments are intended solely for the use of the named addressee(s) and may contain confidential and/or privileged information. Any unauthorized use, copying, disclosure, or distribution of the contents of this e-mail is strictly prohibited by the sender and may be unlawful. If you are not the intended recipient, please notify the sender immediately and delete this e-mail.