summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderick Schertler <roderick@argon.org>1997-03-29 11:33:24 -0500
committerChip Salzenberg <chip@atlantic.net>1997-03-26 07:04:34 +1200
commit5dad0344e72a654bb2ed9a76760452bdb56c6e6d (patch)
tree1e9f3ddf7906147a1bd99f648c597d03d214e560
parentf2506fb2d1c024863b597c56c929ef07b6369d7c (diff)
downloadperl-5dad0344e72a654bb2ed9a76760452bdb56c6e6d.tar.gz
Re: $whoami calculation in Sys::Syslog.pm should not be greedy
On Fri, 28 Mar 1997 16:42:46 -0600 (CST), mer@world.evansville.net (Marc Rouleau) said: > > I suggest replacing > > if (!$ident && $mask =~ /^(\S.*):\s?(.*)/) { > > with > > if (!$ident && $mask =~ /^(\S.*?):\s?(.*)/) { > > at about line 157. Otherwise, syslog'ing text containing a colon > doesn't work right. I think it's a reasonable tradeoff (it'll prevent "foo::bar: message" from working but it'll allow "foo: can't do x: message"). The first probably doesn't work properly with most syslogds anyway, one here would log it as foo:<17.6>:bar[21244]: message p5p-msgid: pz4tdu7j57.fsf@eeyore.ibcinc.com
-rw-r--r--lib/Sys/Syslog.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm
index ee90127340..2da1d769d2 100644
--- a/lib/Sys/Syslog.pm
+++ b/lib/Sys/Syslog.pm
@@ -154,7 +154,7 @@ sub syslog {
$whoami = $ident;
- if (!$ident && $mask =~ /^(\S.*):\s?(.*)/) {
+ if (!$whoami && $mask =~ /^(\S.*?):\s?(.*)/) {
$whoami = $1;
$mask = $2;
}