summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>2005-12-02 19:35:32 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-12-03 11:23:29 +0000
commitce43db9bedd4c6999381bd25cfc0127c2b615272 (patch)
tree99b7851c19a34b4767479c7172358481de16cd82 /ext/Sys
parent43eaf59d25f22137101201b9df220432655a6cc2 (diff)
downloadperl-ce43db9bedd4c6999381bd25cfc0127c2b615272.tar.gz
Sys::Syslog::syslog can accept a message without printf
escapes and arguments. Subject: Re: Perl PR: "Security holes in Sys::Syslog" Message-ID: <lracfi2z23.fsf@caliper.activestate.com> p4raw-id: //depot/perl@26247
Diffstat (limited to 'ext/Sys')
-rw-r--r--ext/Sys/Syslog/Syslog.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index c56d37cb70..4f06357d35 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -7,7 +7,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw(openlog closelog setlogmask syslog);
our @EXPORT_OK = qw(setlogsock);
-our $VERSION = '0.07';
+our $VERSION = '0.08';
# it would be nice to try stream/unix first, since that will be
# most efficient. However streams are dodgy - see _syslog_send_stream
@@ -65,6 +65,8 @@ daemon.
B<You should use openlog() before calling syslog().>
+=item syslog $priority, $message
+
=item syslog $priority, $format, @args
If I<$priority> permits, logs I<($format, @args)>
@@ -320,7 +322,7 @@ sub syslog {
$mask =~ s/(?<!%)%m/$!/g;
$mask .= "\n" unless $mask =~ /\n$/;
- $message = sprintf ($mask, @_);
+ $message = @_ ? sprintf($mask, @_) : $mask;
$sum = $numpri + $numfac;
my $buf = "<$sum>$whoami: $message\0";