From 5dad0344e72a654bb2ed9a76760452bdb56c6e6d Mon Sep 17 00:00:00 2001 From: Roderick Schertler Date: Sat, 29 Mar 1997 11:33:24 -0500 Subject: [PATCH] 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 --- lib/Sys/Syslog.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm index ee901273..2da1d76 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; } -- 1.8.3.1