From: Roderick Schertler Date: Sat, 29 Mar 1997 16:33:24 +0000 (-0500) Subject: Re: $whoami calculation in Sys::Syslog.pm should not be greedy X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5dad0344e72a654bb2ed9a76760452bdb56c6e6d;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm index ee90127..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; }