From: Chris 'BinGOs' Williams Date: Wed, 18 May 2011 23:31:23 +0000 (+0100) Subject: Updated Sys-Syslog to CPAN version 0.29 X-Git-Tag: v5.15.0~256 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/06fd9d7a579f00bca05b6ba920373565ea10c138?hp=d1f3365ee1edd6c60be83dd2d03cbdd0d4278219 Updated Sys-Syslog to CPAN version 0.29 [DELTA] 0.29 -- 2011.04.18 -- Sebastien Aperghis-Tramoni (SAPER) #PerlQA2011 [BUGFIX] CPAN-RT#55215: Sys::Syslog might call exit which triggers DESTROY (Alexander Berger). [BUGFIX] CPAN-RT#55151: Allow temporary facility with native mechanism (Tim Jenkins). [BUGFIX] CPAN-RT#50928: Convert Win32 files to Unix EOLs (Steve Hay). [BUGFIX] CPAN-RT#50534: Unwanted space at the end of syslog message (Eugene V. Lyubimkin). [BUGFIX] CPAN-RT#49877: Options not reset after closelog() (Herbert Brezina). [BUGFIX] CPAN-RT#48386: Add Win32::EventLog as a prerequisite (kmx and Laurent Dami). [FEATURE] CPAN-RT#50534: Added options noeol and nonul. [DIST] Set INSTALLDIRS to "site" when installed on Perl 5.11+ 0.28 -- 2011.04.16 -- Sebastien Aperghis-Tramoni (SAPER) #PerlQA2011 [BUGFIX] CPAN-RT#56084: Reset connection tracking vars (Vladimir Marek). [BUGFIX] CPAN-RT#56826: Avoid memory corruption when closelog() is called twice (Andreas Jaekel). [BUGFIX] CPAN-RT#64287: Make strftime() Windows-compatible (Dave Stafford). [FEATURE] New API for setlogsock(), in order to allow the setting of new options. Thanks to Jake Scott for the idea. [CODE] Modify can_load() so it can print the warnings if desired. [CODE] CPAN-RT#44410: Provide fallback macros in Syslog.xs in order to compile on Novell Netware. [TESTS] In blead, the distribution was moved from ext/Sys/Syslog to ext/Sys-Syslog. t/constants.t had to be fixed (Vincent Pit). [TESTS] CPAN-RT#53317: In core, Sys-Syslog was moved to cpan/, thus making t/constants.t unable to find macros.all (David Mitchell). [TESTS] CPAN-RT#64716: Skip t/data-validation.t if the available version of POE::Component::Server::Syslog is too old. [DIST] Bleadperl no longer require an empty MAN3PODS (Nicholas Clark). [DIST] Removed unneeded modules in Makefile.PL (Nicholas Clark). [DOC] Recreated Sys::Syslog history from the unified git repository. [DOC] Added a section to list the matching Perl and Sys::Syslog version. [DOC] CPAN-RT#49859: Removed a dead link (Leon Brocard). --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index ae2d2f2..8930f4c 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1705,7 +1705,7 @@ use File::Glob qw(:case); 'Sys::Syslog' => { 'MAINTAINER' => 'saper', - 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.27.tar.gz', + 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.29.tar.gz', 'FILES' => q[cpan/Sys-Syslog], 'EXCLUDED' => [ qr{^eg/}, qw{t/data-validation.t diff --git a/cpan/Sys-Syslog/Changes b/cpan/Sys-Syslog/Changes index 2f6653b..81f8bb1 100644 --- a/cpan/Sys-Syslog/Changes +++ b/cpan/Sys-Syslog/Changes @@ -1,5 +1,41 @@ Revision history for Sys-Syslog +0.29 -- 2011.04.18 -- Sebastien Aperghis-Tramoni (SAPER) #PerlQA2011 + [BUGFIX] CPAN-RT#55215: Sys::Syslog might call exit which triggers + DESTROY (Alexander Berger). + [BUGFIX] CPAN-RT#55151: Allow temporary facility with native mechanism + (Tim Jenkins). + [BUGFIX] CPAN-RT#50928: Convert Win32 files to Unix EOLs (Steve Hay). + [BUGFIX] CPAN-RT#50534: Unwanted space at the end of syslog message + (Eugene V. Lyubimkin). + [BUGFIX] CPAN-RT#49877: Options not reset after closelog() (Herbert Brezina). + [BUGFIX] CPAN-RT#48386: Add Win32::EventLog as a prerequisite (kmx and + Laurent Dami). + [FEATURE] CPAN-RT#50534: Added options noeol and nonul. + [DIST] Set INSTALLDIRS to "site" when installed on Perl 5.11+ + +0.28 -- 2011.04.16 -- Sebastien Aperghis-Tramoni (SAPER) #PerlQA2011 + [BUGFIX] CPAN-RT#56084: Reset connection tracking vars (Vladimir Marek). + [BUGFIX] CPAN-RT#56826: Avoid memory corruption when closelog() is + called twice (Andreas Jaekel). + [BUGFIX] CPAN-RT#64287: Make strftime() Windows-compatible (Dave Stafford). + [FEATURE] New API for setlogsock(), in order to allow the setting + of new options. Thanks to Jake Scott for the idea. + [CODE] Modify can_load() so it can print the warnings if desired. + [CODE] CPAN-RT#44410: Provide fallback macros in Syslog.xs in + order to compile on Novell Netware. + [TESTS] In blead, the distribution was moved from ext/Sys/Syslog + to ext/Sys-Syslog. t/constants.t had to be fixed (Vincent Pit). + [TESTS] CPAN-RT#53317: In core, Sys-Syslog was moved to cpan/, thus + making t/constants.t unable to find macros.all (David Mitchell). + [TESTS] CPAN-RT#64716: Skip t/data-validation.t if the available + version of POE::Component::Server::Syslog is too old. + [DIST] Bleadperl no longer require an empty MAN3PODS (Nicholas Clark). + [DIST] Removed unneeded modules in Makefile.PL (Nicholas Clark). + [DOC] Recreated Sys::Syslog history from the unified git repository. + [DOC] Added a section to list the matching Perl and Sys::Syslog version. + [DOC] CPAN-RT#49859: Removed a dead link (Leon Brocard). + 0.27 -- 2008.09.21 -- Sebastien Aperghis-Tramoni (SAPER) [BUGFIX] Fixed compilation on Win32, thanks to Serguei Trouchelle. Also added stubs so calling the XS functions will never fail. @@ -167,6 +203,8 @@ Revision history for Sys-Syslog [TESTS] Added t/distchk.t, t/podspell.t, t/podcover.t, t/portfs.t 0.09 -- 2005.12.06 -- Sebastien Aperghis-Tramoni (SAPER) + [BUGFIX] Escape percent signs in error message when interpolating %m + (Ronald J. Kimball). [CODE] Now setlogsock() really croak(), as documented. [DIST] CPANized from blead@26281. [DIST] Modified Makefile.PL so that ExtUtils::Constant is conditionaly @@ -175,3 +213,81 @@ Revision history for Sys-Syslog [DOC] Added support and license information. [TESTS] Rewrote and ported t/syslog.t to Test::More +0.08 -- 2005.12.03 + [FEATURES] syslog() can now accept a message without printf() escapes + and arguments (Gisle Aas ). + [DOC] Document that openlog() might die (Rafael Garcia-Suarez). + +0.07 -- 2005.06.27 + [CODE] Use XSLoader instead of DynaLoader (Alexey Tourbin). + [DOC] Shows the correct way to use syslog() (Dave Mitchell). + +0.06 -- 2004.12.14 + [FEATURE] Allow escaping %m as %%m in Sys::Syslog format strings (Rafael + Garcia-Suarez, suggested by Joshua Richardson and Yitzchak Scott-Thoennes). + [CODE] Make Sys::Syslog stricture-compliant (Rafael Garcia-Suarez). + [DOC] Document $Sys::Syslog::host (Jay Hannah). + +0.05 -- 2004.04.06 + [FEATURE] IRIX wants setlogsock("stream") (Jarkko Hietaniemi). + [FEATURE] Allow syslog() to use numeric constants in addition to strings + for facility names and priorities (Jim Schneider ). + [DOC] Remind users to always use openlog() (Jarkko Hietaniemi). + +0.04 -- 2003.08.13 + [BUGFIX] Do not use "udp" on some platforms (Slaven Rezic). + [BUGFIX] Perl-RT#18180: Fixed a problem with Sys:Syslog on Solaris 8 + with perl 5.8.0 (Joost van Baal). + [BUGFIX] Fixed some warnings (Jarkko Hietaniemi). + [BUGFIX] Better error messages (Jari Aalto). + +0.03 -- 2002.03.23 + [BUGFIX] Fixed copious warnings from Sys::Syslog (Andreas König). + [FEATURE] Failover to different communication modes by Nick Williams. + +0.02 -- 2001.06.04 + [BUGFIX] /dev/console may not be writable in Syslog.pm (Ask Bjoern Hansen). + [BUGFIX] Fixed for accidental arguments to autoloaded constants (Gurusamy Sarathy). + [BUGFIX] Make _PATH_LOG() return "" if not available (Gurusamy Sarathy). + [BUGFIX] Forked child may not exit correctly if it failed to open + /dev/console (Graham Barr). + [BUGFIX] More checking in case someone has broken their services or + protocol databases (Robert Spier). + [BUGFIX] xlate() doesn't handle LOG_EMERG (Mark J. Reed). + [CODE] Code for constant()s regenerated by Nicholas Clark. + [TESTS] Added syslog.t to check if Sys::Syslog works (Tom Hughes). + +0.01 -- 2000.02.04 -- Gurusamy Sarathy + [FEATURE] Sys::Syslog now uses XSUBs to access facilities from syslog.h + so it no longer requires syslog.ph to exist. Thanks to Tom Hughes. + As a consequence, Sys::Syslog moved from lib/ to ext/. + +perl 5.004_03 -- 1997.09.05 -- Tim Bunce + [BUGFIX] Handle missing _PATH_LOG (Ulrich Pfeifer). + +perl 5.004_02 -- 1997.08.07 -- Tim Bunce + [FEATURE] UNIX domain sockets support, by Sean Robinson and Tim Bunce. + +perl 5.004_01 -- 1997.06.11 -- Tim Bunce + [BUGFIX] Allows FQDN (even allowing "_"). + +perl 5.004 -- 1997.05.15 -- Chip Salzenberg + [BUGFIX] Fixed $whoami calulation (Marc Rouleau). + [BUGFIX] Allows hyphens in hostnames (Jerome Abela). + +perl 5.003_01 -- 1996.06.18 -- Charles Bailey + [CODE] Moved call to hostname() into connect() function, and eliminated + domain suffix. + [DOC] Correct documentation for calling sequence of syslog() function. + +perl 5.002_01 -- 1996.03.25 -- Charles Bailey + [CODE] Use Sys::Hostname::hostname() only when necessary. + +perl 5.002 -- 1996.02.29 -- Larry Wall + [CODE] Use constants from Socket.pm (Andy Dougherty). + [CODE] Connect to the name given by Sys::Hostname::hostname() instead + of "localhost" (Andy Dougherty). + [DOC] Added documentation, thanks to Hallvard B Furuseth. + +perl 5.000 -- 1994.10.17 -- Larry Wall + [DIST] Converted from lib/syslog.pl to lib/Sys/Syslog.pm diff --git a/cpan/Sys-Syslog/Makefile.PL b/cpan/Sys-Syslog/Makefile.PL index 790853c..a402896 100644 --- a/cpan/Sys-Syslog/Makefile.PL +++ b/cpan/Sys-Syslog/Makefile.PL @@ -1,11 +1,8 @@ +use 5.005; use strict; -use Config; use ExtUtils::MakeMaker; -eval 'use ExtUtils::MakeMaker::Coverage'; use File::Copy; -use File::Path; use File::Spec; -require 5.005; # create a typemap for Perl 5.6 @@ -23,14 +20,15 @@ my %virtual_path = ( 'Syslog.pm' => '$(INST_LIBDIR)/Syslog.pm' ); # detect when to use Win32::EvenLog my (@extra_params, @extra_prereqs); -my $use_eventlog = eval "use Win32::EventLog; 1"; -if ($use_eventlog) { +if ($^O =~ /Win32/) { print " * Win32::EventLog detected.\n"; my $name = "PerlLog"; push @extra_prereqs, - Win32 => 0, "Win32::TieRegistry" => 0, "Win32::EventLog" => 0; + "Win32::EventLog" => 0, + "Win32::TieRegistry" => 0, + "Win32::EventLog" => 0; $virtual_path{'win32/Win32.pm' } = '$(INST_LIBDIR)/Syslog/Win32.pm'; $virtual_path{'win32/PerlLog.dll'} = '$(INST_ARCHAUTODIR)/PerlLog.dll'; @@ -53,22 +51,9 @@ if ($use_eventlog) { close(DLL); } } -elsif ($^O =~ /Win32/) { - print <<"NOTICE" - *** You're running on a Win32 system, but you lack the Win32::EventLog\a - *** module, part of the libwin32 distribution. Although Sys::Syslog can - *** be used without Win32::EventLog, it won't be very useful except for - *** sending remote syslog messages. If you want to log messages on the - *** local host as well, please install libwin32 then Sys::Syslog again. -NOTICE -} # detect when being built in Perl core -if (grep { $_ eq 'PERL_CORE=1' } @ARGV) { - push @extra_params, - MAN3PODS => {}; # Pods will be built by installman. -} -else { +if (not grep { $_ eq 'PERL_CORE=1' } @ARGV) { push @extra_params, DEFINE => '-DUSE_PPPORT_H'; } @@ -76,13 +61,18 @@ else { # on pre-5.6 Perls, add warnings::compat to the prereq modules push @extra_prereqs, "warnings::compat" => "0.06" if $] < 5.006; +# starting with Perl 5.11, "site" and "vendor" directories finally are +# before "perl" (core) in @INC, thus allowing dual-life modules to be +# updated without the need to overwrite the old version +my $installdirs = $] < 5.011 ? "perl" : "site"; + WriteMakefile( NAME => 'Sys::Syslog', LICENSE => 'perl', AUTHOR => 'Sebastien Aperghis-Tramoni ', VERSION_FROM => 'Syslog.pm', ABSTRACT_FROM => 'Syslog.pm', - INSTALLDIRS => 'perl', + INSTALLDIRS => $installdirs, XSPROTOARG => '-noprototypes', PM => \%virtual_path, PREREQ_PM => { diff --git a/cpan/Sys-Syslog/README b/cpan/Sys-Syslog/README index 68bf1b6..d68a12a 100644 --- a/cpan/Sys-Syslog/README +++ b/cpan/Sys-Syslog/README @@ -63,7 +63,7 @@ SUPPORT AND DOCUMENTATION COPYRIGHT AND LICENCE - Copyright (C) 1990-2008 by Larry Wall and others. + Copyright (C) 1990-2009 by Larry Wall and others. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Sys-Syslog/Syslog.pm b/cpan/Sys-Syslog/Syslog.pm index 002e6e4..a68f817 100644 --- a/cpan/Sys-Syslog/Syslog.pm +++ b/cpan/Sys-Syslog/Syslog.pm @@ -3,16 +3,17 @@ use strict; use warnings; use warnings::register; use Carp; -use Exporter (); -use Fcntl qw(O_WRONLY); +use Exporter (); +use Fcntl qw< O_WRONLY >; use File::Basename; -use POSIX qw(strftime setlocale LC_TIME); -use Socket ':all'; +use POSIX qw< strftime setlocale LC_TIME >; +use Socket qw< :all >; require 5.005; + { no strict 'vars'; - $VERSION = '0.27'; - @ISA = qw(Exporter); + $VERSION = '0.29'; + @ISA = qw< Exporter >; %EXPORT_TAGS = ( standard => [qw(openlog syslog closelog setlogmask)], @@ -86,20 +87,23 @@ sub silent_eval (&); # Global variables # use vars qw($facility); -my $connected = 0; # flag to indicate if we're connected or not +my $connected = 0; # flag to indicate if we're connected or not my $syslog_send; # coderef of the function used to send messages -my $syslog_path = undef; # syslog path for "stream" and "unix" mechanisms -my $syslog_xobj = undef; # if defined, holds the external object used to send messages -my $transmit_ok = 0; # flag to indicate if the last message was transmited -my $sock_timeout = 0; # socket timeout, see below -my $current_proto = undef; # current mechanism used to transmit messages -my $ident = ''; # identifiant prepended to each message -$facility = ''; # current facility -my $maskpri = LOG_UPTO(&LOG_DEBUG); # current log mask +my $syslog_path = undef; # syslog path for "stream" and "unix" mechanisms +my $syslog_xobj = undef; # if defined, holds the external object used to send messages +my $transmit_ok = 0; # flag to indicate if the last message was transmited +my $sock_port = undef; # socket port +my $sock_timeout = 0; # socket timeout, see below +my $current_proto = undef; # current mechanism used to transmit messages +my $ident = ''; # identifiant prepended to each message +$facility = ''; # current facility +my $maskpri = LOG_UPTO(&LOG_DEBUG); # current log mask my %options = ( ndelay => 0, + noeol => 0, nofatal => 0, + nonul => 0, nowait => 0, perror => 0, pid => 0, @@ -108,7 +112,7 @@ my %options = ( # Default is now to first use the native mechanism, so Perl programs # behave like other normal Unix programs, then try other mechanisms. my @connectMethods = qw(native tcp udp unix pipe stream console); -if ($^O =~ /^(freebsd|linux)$/) { +if ($^O eq "freebsd" or $^O eq "linux") { @connectMethods = grep { $_ ne 'udp' } @connectMethods; } @@ -117,12 +121,9 @@ if ($^O =~ /^(freebsd|linux)$/) { EVENTLOG: { my $is_Win32 = $^O =~ /Win32/i; - if (can_load("Sys::Syslog::Win32")) { + if (can_load("Sys::Syslog::Win32", $is_Win32)) { unshift @connectMethods, 'eventlog'; } - elsif ($is_Win32) { - warn $@; - } } my @defaultMethods = @connectMethods; @@ -177,8 +178,11 @@ sub openlog { } sub closelog { - $facility = $ident = ''; - disconnect_log(); + disconnect_log() if $connected; + $options{$_} = 0 for keys %options; + $facility = $ident = ""; + $connected = 0; + return 1 } sub setlogmask { @@ -186,117 +190,135 @@ sub setlogmask { $maskpri = shift unless $_[0] == 0; $oldmask; } - -sub setlogsock { - my ($setsock, $setpath, $settime) = @_; - - # check arguments - my $diag_invalid_arg - = "Invalid argument passed to setlogsock; must be 'stream', 'pipe', " - . "'unix', 'native', 'eventlog', 'tcp', 'udp' or 'inet'"; - croak $diag_invalid_arg unless defined $setsock; - croak "Invalid number of arguments" unless @_ >= 1 and @_ <= 3; - - $syslog_path = $setpath if defined $setpath; - $sock_timeout = $settime if defined $settime; - disconnect_log() if $connected; - $transmit_ok = 0; - @fallbackMethods = (); - @connectMethods = @defaultMethods; - - if (ref $setsock eq 'ARRAY') { - @connectMethods = @$setsock; - - } elsif (lc $setsock eq 'stream') { - if (not defined $syslog_path) { - my @try = qw(/dev/log /dev/conslog); - - if (length &_PATH_LOG) { # Undefined _PATH_LOG is "". - unshift @try, &_PATH_LOG; - } - - for my $try (@try) { - if (-w $try) { - $syslog_path = $try; - last; - } - } +my %mechanism = ( + console => { + check => sub { 1 }, + }, + eventlog => { + check => sub { return can_load("Win32::EventLog") }, + err_msg => "no Win32 API available", + }, + inet => { + check => sub { 1 }, + }, + native => { + check => sub { 1 }, + }, + pipe => { + check => sub { + ($syslog_path) = grep { defined && length && -p && -w _ } + $syslog_path, &_PATH_LOG, "/dev/log"; + return $syslog_path ? 1 : 0 + }, + err_msg => "path not available", + }, + stream => { + check => sub { if (not defined $syslog_path) { - warnings::warnif "stream passed to setlogsock, but could not find any device"; - return undef + my @try = qw(/dev/log /dev/conslog); + unshift @try, &_PATH_LOG if length &_PATH_LOG; + ($syslog_path) = grep { -w } @try; } + return defined $syslog_path && -w $syslog_path + }, + err_msg => "could not find any writable device", + }, + tcp => { + check => sub { + if (getservbyname('syslog', 'tcp') || getservbyname('syslogng', 'tcp')) { + $host = $syslog_path; + return 1 + } + else { + return + } + }, + err_msg => "TCP service unavailable", + }, + udp => { + check => sub { + if (getservbyname('syslog', 'udp')) { + $host = $syslog_path; + return 1 + } + else { + return + } + }, + err_msg => "UDP service unavailable", + }, + unix => { + check => sub { + my @try = ($syslog_path, &_PATH_LOG); + ($syslog_path) = grep { defined && length && -w } @try; + return defined $syslog_path && -w $syslog_path + }, + err_msg => "path not available", + }, +); + +sub setlogsock { + my %opt; + + # handle arguments + # - old API: setlogsock($sock_type, $sock_path, $sock_timeout) + # - new API: setlogsock(\%options) + croak "setlogsock(): Invalid number of arguments" + unless @_ >= 1 and @_ <= 3; + + if (my $ref = ref $_[0]) { + if ($ref eq "HASH") { + %opt = %{ $_[0] }; + croak "setlogsock(): No argument given" unless keys %opt; } - - if (not -w $syslog_path) { - warnings::warnif "stream passed to setlogsock, but $syslog_path is not writable"; - return undef; - } else { - @connectMethods = qw(stream); - } - - } elsif (lc $setsock eq 'unix') { - if (length _PATH_LOG() || (defined $syslog_path && -w $syslog_path)) { - $syslog_path = _PATH_LOG() unless defined $syslog_path; - @connectMethods = qw(unix); - } else { - warnings::warnif 'unix passed to setlogsock, but path not available'; - return undef; - } - - } elsif (lc $setsock eq 'pipe') { - for my $path ($syslog_path, &_PATH_LOG, "/dev/log") { - next unless defined $path and length $path and -p $path and -w _; - $syslog_path = $path; - last - } - - if (not $syslog_path) { - warnings::warnif "pipe passed to setlogsock, but path not available"; - return undef + elsif ($ref eq "ARRAY") { + @opt{qw< type path timeout >} = @_; } - - @connectMethods = qw(pipe); - - } elsif (lc $setsock eq 'native') { - @connectMethods = qw(native); - - } elsif (lc $setsock eq 'eventlog') { - if (can_load("Win32::EventLog")) { - @connectMethods = qw(eventlog); - } else { - warnings::warnif "eventlog passed to setlogsock, but no Win32 API available"; - $@ = ""; - return undef; + else { + croak "setlogsock(): Unexpected \L$ref\E reference" } + } + else { + @opt{qw< type path timeout >} = @_; + } - } elsif (lc $setsock eq 'tcp') { - if (getservbyname('syslog', 'tcp') || getservbyname('syslogng', 'tcp')) { - @connectMethods = qw(tcp); - $host = $syslog_path; - } else { - warnings::warnif "tcp passed to setlogsock, but tcp service unavailable"; - return undef; - } + # check socket type, remove + my $diag_invalid_type = "setlogsock(): Invalid type%s; must be one of " + . join ", ", map { "'$_'" } sort keys %mechanism; + croak sprintf $diag_invalid_type, "" unless defined $opt{type}; + my @sock_types = ref $opt{type} eq "ARRAY" ? @{$opt{type}} : ($opt{type}); + my @tmp; + + for my $sock_type (@sock_types) { + carp sprintf $diag_invalid_type, " '$sock_type'" and next + unless exists $mechanism{$sock_type}; + push @tmp, "tcp", "udp" and next if $sock_type eq "inet"; + push @tmp, $sock_type; + } - } elsif (lc $setsock eq 'udp') { - if (getservbyname('syslog', 'udp')) { - @connectMethods = qw(udp); - $host = $syslog_path; - } else { - warnings::warnif "udp passed to setlogsock, but udp service unavailable"; - return undef; - } + @sock_types = @tmp; - } elsif (lc $setsock eq 'inet') { - @connectMethods = ( 'tcp', 'udp' ); + # set global options + $syslog_path = $opt{path} if defined $opt{path}; + $host = $opt{host} if defined $opt{host}; + $sock_timeout = $opt{timeout} if defined $opt{timeout}; + $sock_port = $opt{port} if defined $opt{port}; - } elsif (lc $setsock eq 'console') { - @connectMethods = qw(console); + disconnect_log() if $connected; + $transmit_ok = 0; + @fallbackMethods = (); + @connectMethods = @defaultMethods; - } else { - croak $diag_invalid_arg + for my $sock_type (@sock_types) { + if ( $mechanism{$sock_type}{check}->() ) { + unshift @connectMethods, $sock_type; + } + else { + warnings::warnif "setlogsock(): type='$sock_type': " + . $mechanism{$sock_type}{err_msg}; + } } return 1; @@ -320,30 +342,43 @@ sub syslog { croak "syslog: expecting argument \$priority" unless defined $priority; croak "syslog: expecting argument \$format" unless defined $mask; - croak "syslog: invalid level/facility: $priority" if $priority =~ /^-\d+$/; - @words = split(/\W+/, $priority, 2); # Allow "level" or "level|facility". - undef $numpri; - undef $numfac; + if ($priority =~ /^\d+$/) { + $numpri = LOG_PRI($priority); + $numfac = LOG_FAC($priority); + } + elsif ($priority =~ /^\w+/) { + # Allow "level" or "level|facility". + @words = split /\W+/, $priority, 2; - for my $word (@words) { - next if length $word == 0; + undef $numpri; + undef $numfac; - $num = xlate($word); # Translate word to number. + for my $word (@words) { + next if length $word == 0; - if ($num < 0) { - croak "syslog: invalid level/facility: $word" - } - elsif ($num <= &LOG_PRIMASK) { - croak "syslog: too many levels given: $word" if defined $numpri; - $numpri = $num; - return 0 unless LOG_MASK($numpri) & $maskpri; - } - else { - croak "syslog: too many facilities given: $word" if defined $numfac; - $facility = $word; - $numfac = $num; + # Translate word to number. + $num = xlate($word); + + if ($num < 0) { + croak "syslog: invalid level/facility: $word" + } + elsif (my $pri = LOG_PRI($num)) { + croak "syslog: too many levels given: $word" + if defined $numpri; + $numpri = $num; + return 0 unless LOG_MASK($numpri) & $maskpri; + } + else { + croak "syslog: too many facilities given: $word" + if defined $numfac; + $facility = $word if $word =~ /^[A-Za-z]/; + $numfac = LOG_FAC($num); + } } } + else { + croak "syslog: invalid level/facility: $priority" + } croak "syslog: level must be given" unless defined $numpri; @@ -364,10 +399,6 @@ sub syslog { $mask .= "\n" unless $mask =~ /\n$/; $message = @_ ? sprintf($mask, @_) : $mask; - # See CPAN-RT#24431. Opened on Apple Radar as bug #4944407 on 2007.01.21 - # Supposedly resolved on Leopard. - chomp $message if $^O =~ /darwin/; - if ($current_proto eq 'native') { $buf = $message; } @@ -381,15 +412,22 @@ sub syslog { $sum = $numpri + $numfac; my $oldlocale = setlocale(LC_TIME); setlocale(LC_TIME, 'C'); - my $timestamp = strftime "%b %e %T", localtime; + my $timestamp = strftime "%b %e %H:%M:%S", localtime; setlocale(LC_TIME, $oldlocale); - $buf = "<$sum>$timestamp $whoami: $message\0"; + + # construct the stream that will be transmitted + $buf = "<$sum>$timestamp $whoami: $message"; + + # add (or not) a newline + $buf .= "\n" if !$options{noeol} and rindex($buf, "\n") == -1; + + # add (or not) a NUL character + $buf .= "\0" if !$options{nonul}; } # handle PERROR option # "native" mechanism already handles it by itself if ($options{perror} and $current_proto ne 'native') { - chomp $message; my $whoami = $ident; $whoami .= "[$$]" if $options{pid}; print STDERR "$whoami: $message\n"; @@ -436,7 +474,7 @@ sub syslog { sub _syslog_send_console { my ($buf) = @_; - chop($buf); # delete the NUL from the end + # The console print is a method which could block # so we do it in a child process and always return success # to the caller. @@ -456,10 +494,11 @@ sub _syslog_send_console { } else { if (open(CONS, ">/dev/console")) { my $ret = print CONS $buf . "\r"; # XXX: should this be \x0A ? - exit $ret if defined $pid; + POSIX::_exit $ret if defined $pid; close CONS; } - exit if defined $pid; + + POSIX::_exit if defined $pid; } } @@ -484,8 +523,8 @@ sub _syslog_send_socket { } sub _syslog_send_native { - my ($buf, $numpri) = @_; - syslog_xs($numpri, $buf); + my ($buf, $numpri, $numfac) = @_; + syslog_xs($numpri|$numfac, $buf); return 1; } @@ -560,15 +599,15 @@ sub connect_log { sub connect_tcp { my ($errs) = @_; - my $tcp = getprotobyname('tcp'); - if (!defined $tcp) { + my $proto = getprotobyname('tcp'); + if (!defined $proto) { push @$errs, "getprotobyname failed for tcp"; return 0; } - my $syslog = getservbyname('syslog', 'tcp'); - $syslog = getservbyname('syslogng', 'tcp') unless defined $syslog; - if (!defined $syslog) { + my $port = $sock_port || getservbyname('syslog', 'tcp'); + $port = getservbyname('syslogng', 'tcp') unless defined $port; + if (!defined $port) { push @$errs, "getservbyname failed for syslog/tcp and syslogng/tcp"; return 0; } @@ -583,9 +622,9 @@ sub connect_tcp { } else { $addr = INADDR_LOOPBACK; } - $addr = sockaddr_in($syslog, $addr); + $addr = sockaddr_in($port, $addr); - if (!socket(SYSLOG, AF_INET, SOCK_STREAM, $tcp)) { + if (!socket(SYSLOG, AF_INET, SOCK_STREAM, $proto)) { push @$errs, "tcp socket: $!"; return 0; } @@ -608,14 +647,14 @@ sub connect_tcp { sub connect_udp { my ($errs) = @_; - my $udp = getprotobyname('udp'); - if (!defined $udp) { + my $proto = getprotobyname('udp'); + if (!defined $proto) { push @$errs, "getprotobyname failed for udp"; return 0; } - my $syslog = getservbyname('syslog', 'udp'); - if (!defined $syslog) { + my $port = $sock_port || getservbyname('syslog', 'udp'); + if (!defined $port) { push @$errs, "getservbyname failed for syslog/udp"; return 0; } @@ -630,9 +669,9 @@ sub connect_udp { } else { $addr = INADDR_LOOPBACK; } - $addr = sockaddr_in($syslog, $addr); + $addr = sockaddr_in($port, $addr); - if (!socket(SYSLOG, AF_INET, SOCK_DGRAM, $udp)) { + if (!socket(SYSLOG, AF_INET, SOCK_DGRAM, $proto)) { push @$errs, "udp socket: $!"; return 0; } @@ -790,10 +829,14 @@ sub disconnect_log { if (defined $current_proto and $current_proto eq 'native') { closelog_xs(); + unshift @fallbackMethods, $current_proto; + $current_proto = undef; return 1; } elsif (defined $current_proto and $current_proto eq 'eventlog') { $syslog_xobj->Close(); + unshift @fallbackMethods, $current_proto; + $current_proto = undef; return 1; } @@ -814,8 +857,11 @@ sub silent_eval (&) { } sub can_load { + my ($module, $verbose) = @_; local($SIG{__DIE__}, $SIG{__WARN__}, $@); - return eval "use $_[0]; 1" + my $loaded = eval "use $module; 1"; + warn $@ if not $loaded and $verbose; + return $loaded } @@ -829,18 +875,17 @@ Sys::Syslog - Perl interface to the UNIX syslog(3) calls =head1 VERSION -Version 0.27 +This is the documentation of version 0.29 =head1 SYNOPSIS - use Sys::Syslog; # all except setlogsock(), or: - use Sys::Syslog qw(:DEFAULT setlogsock); # default set, plus setlogsock() - use Sys::Syslog qw(:standard :macros); # standard functions, plus macros + use Sys::Syslog; # all except setlogsock() + use Sys::Syslog qw(:standard :macros); # standard functions & macros - openlog $ident, $logopt, $facility; # don't forget this - syslog $priority, $format, @args; - $oldmask = setlogmask $mask_priority; - closelog; + openlog($ident, $logopt, $facility); # don't forget this + syslog($priority, $format, @args); + $oldmask = setlogmask($mask_priority); + closelog(); =head1 DESCRIPTION @@ -919,12 +964,22 @@ opened when the first message is logged). =item * +C - When set to true, no end of line character (C<\n>) will be +appended to the message. This can be useful for some buggy syslog daemons. + +=item * + C - When set to true, C and C will only emit warnings instead of dying if the connection to the syslog can't be established. =item * +C - When set to true, no C character (C<\0>) will be +appended to the message. This can be useful for some buggy syslog daemons. + +=item * + C - Don't wait for child processes that may have been created while logging the message. (The GNU C library does not create a child process, so this option has no effect on Linux.) @@ -932,7 +987,7 @@ process, so this option has no effect on Linux.) =item * C - Write the message to standard error output as well to the -system log. +system log (added in C 0.22). =item * @@ -962,7 +1017,7 @@ C<"$!"> (the latest error message). C<$priority> can specify a level, or a level and a facility. Levels and facilities can be given as strings or as macros. When using the C mechanism, priorities C and C are mapped to event type -C, C and C to C and C to +C, C and C to C and C to C to C. If you didn't use C before using C, C will @@ -971,11 +1026,13 @@ C<$format> that ends in a C<":">. B - syslog("info", $message); # informational level - syslog(LOG_INFO, $message); # informational level + # informational level + syslog("info", $message); + syslog(LOG_INFO, $message); - syslog("info|local0", $message); # information level, Local0 facility - syslog(LOG_INFO|LOG_LOCAL0, $message); # information level, Local0 facility + # information level, Local0 facility + syslog("info|local0", $message); + syslog(LOG_INFO|LOG_LOCAL0, $message); =over 4 @@ -1012,22 +1069,79 @@ Log everything except informational messages: Log critical messages, errors and warnings: - setlogmask( LOG_MASK(LOG_CRIT) | LOG_MASK(LOG_ERR) | LOG_MASK(LOG_WARNING) ); + setlogmask( LOG_MASK(LOG_CRIT) + | LOG_MASK(LOG_ERR) + | LOG_MASK(LOG_WARNING) ); Log all messages up to debug: setlogmask( LOG_UPTO(LOG_DEBUG) ); -=item B +=item B + +Sets the socket type and options to be used for the next call to C +or C. Returns true on success, C on failure. -=item B (added in Perl 5.004_02) +Being Perl-specific, this function has evolved along time. It can currently +be called as follow: -=item B (added in 0.25) +=over + +=item * + +C + +=item * + +C (added in Perl 5.004_02) + +=item * + +C (added in +C 0.25) + +=item * + +C (added in C 0.28) + +=back -Sets the socket type to be used for the next call to -C or C and returns true on success, -C on failure. The available mechanisms are: +The available options are: + +=over + +=item * + +C - equivalent to C<$sock_type>, selects the socket type (or +"mechanism"). An array reference can be passed to specify several +mechanisms to try, in the given order. + +=item * + +C - equivalent to C<$stream_location>, sets the stream location. +Defaults to standard Unix location, or C<_PATH_LOG>. + +=item * + +C - equivalent to C<$sock_timeout>, sets the socket timeout +in seconds. Defaults to 0 on all systems except S where it +is set to 0.25 sec. + +=item * + +C - sets the hostname to send the messages to. Defaults to +the local host. + +=item * + +C - sets the TCP or UDP port to connect to. Defaults to the +first standard syslog port available on the system. + +=back + + +The available mechanisms are: =over @@ -1044,39 +1158,38 @@ added in C 0.19). =item * C<"tcp"> - connect to a TCP socket, on the C or C -service. If defined, the second parameter is used as a hostname to connect to. +service. See also the C, C and C options. =item * C<"udp"> - connect to a UDP socket, on the C service. -If defined, the second parameter is used as a hostname to connect to, -and the third parameter as the timeout used to check for UDP response. +See also the C, C and C options. =item * C<"inet"> - connect to an INET socket, either TCP or UDP, tried in that -order. If defined, the second parameter is used as a hostname to connect to. +order. See also the C, C and C options. =item * C<"unix"> - connect to a UNIX domain socket (in some systems a character -special device). The name of that socket is the second parameter or, if -you omit the second parameter, the value returned by the C<_PATH_LOG> macro -(if your system defines it), or F or F, whatever is -writable. +special device). The name of that socket is given by the C option +or, if omitted, the value returned by the C<_PATH_LOG> macro (if your +system defines it), F or F, whichever is writable. =item * -C<"stream"> - connect to the stream indicated by the pathname provided as -the optional second parameter, or, if omitted, to F. -For example Solaris and IRIX system may prefer C<"stream"> instead of C<"unix">. +C<"stream"> - connect to the stream indicated by the C option, or, +if omitted, the value returned by the C<_PATH_LOG> macro (if your system +defines it), F or F, whichever is writable. For +example Solaris and IRIX system may prefer C<"stream"> instead of C<"unix">. =item * -C<"pipe"> - connect to the named pipe indicated by the pathname provided as -the optional second parameter, or, if omitted, to the value returned by -the C<_PATH_LOG> macro (if your system defines it), or F -(added in C 0.21). +C<"pipe"> - connect to the named pipe indicated by the C option, +or, if omitted, to the value returned by the C<_PATH_LOG> macro (if your +system defines it), or F (added in C 0.21). +HP-UX is a system which uses such a named pipe. =item * @@ -1085,10 +1198,6 @@ option of C. =back -A reference to an array can also be passed as the first parameter. -When this calling method is used, the array should contain a list of -mechanisms which are attempted in order. - The default is to try C, C, C, C, C, C, C. Under systems with the Win32 API, C will be added as the first @@ -1098,11 +1207,19 @@ Giving an invalid value for C<$sock_type> will C. B -Select the UDP socket mechanism: +Select the UDP socket mechanism: setlogsock("udp"); -Select the native, UDP socket then UNIX domain socket mechanisms: +Send messages using the TCP socket mechanism on a custom port: + + setlogsock({ type => "tcp", port => 2486 }); + +Send messages to a remote host using the TCP socket mechanism: + + setlogsock({ type => "tcp", host => $loghost }); + +Try the native, UDP socket then UNIX domain socket mechanisms: setlogsock(["native", "udp", "unix"]); @@ -1392,6 +1509,29 @@ was unable to find an appropriate an appropriate device. =back +=head1 HISTORY + +C is a core module, part of the standard Perl distribution +since 1990. At this time, modules as we know them didn't exist, the +Perl library was a collection of F<.pl> files, and the one for sending +syslog messages with was simply F, included with Perl 3.0. +It was converted as a module with Perl 5.0, but had a version number +only starting with Perl 5.6. Here is a small table with the matching +Perl and C versions. + + Sys::Syslog Perl + ----------- ---- + undef 5.0.x -- 5.5.x + 0.01 5.6.0, 5.6.1, 5.6.2 + 0.03 5.8.0 + 0.04 5.8.1, 5.8.2, 5.8.3 + 0.05 5.8.4, 5.8.5, 5.8.6 + 0.06 5.8.7 + 0.13 5.8.8 + 0.22 5.10.0 + 0.27 5.8.9 + + =head1 SEE ALSO =head2 Manual Pages @@ -1502,7 +1642,7 @@ L =item * RT: CPAN's request tracker -L +L =item * Search CPAN @@ -1521,7 +1661,7 @@ L =head1 COPYRIGHT -Copyright (C) 1990-2008 by Larry Wall and others. +Copyright (C) 1990-2009 by Larry Wall and others. =head1 LICENSE @@ -1563,7 +1703,6 @@ but also has this strange piece of code: I don't know what bug the author referred to. - L -- L - L diff --git a/cpan/Sys-Syslog/Syslog.xs b/cpan/Sys-Syslog/Syslog.xs index 704ed9e..e1ba675 100644 --- a/cpan/Sys-Syslog/Syslog.xs +++ b/cpan/Sys-Syslog/Syslog.xs @@ -1,3 +1,10 @@ +/* + * Syslog.xs + * + * XS wrapper for the syslog(3) facility. + * + */ + #if defined(_WIN32) # include #endif @@ -26,6 +33,29 @@ static SV *ident_svptr; #include "const-c.inc" + +#ifndef LOG_FAC +#define LOG_FACMASK 0x03f8 +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) +#endif + +#ifndef LOG_PRI +#define LOG_PRI(p) ((p) & LOG_PRIMASK) +#endif + +#ifndef LOG_MAKEPRI +#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) +#endif + +#ifndef LOG_MASK +#define LOG_MASK(pri) (1 << (pri)) +#endif + +#ifndef LOG_UPTO +#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) +#endif + + MODULE = Sys::Syslog PACKAGE = Sys::Syslog INCLUDE: const-xs.inc @@ -34,72 +64,27 @@ int LOG_FAC(p) INPUT: int p - CODE: -#ifdef LOG_FAC - RETVAL = LOG_FAC(p); -#else - croak("Your vendor has not defined the Sys::Syslog macro LOG_FAC"); - RETVAL = -1; -#endif - OUTPUT: - RETVAL int LOG_PRI(p) INPUT: int p - CODE: -#ifdef LOG_PRI - RETVAL = LOG_PRI(p); -#else - croak("Your vendor has not defined the Sys::Syslog macro LOG_PRI"); - RETVAL = -1; -#endif - OUTPUT: - RETVAL int LOG_MAKEPRI(fac,pri) INPUT: int fac int pri - CODE: -#ifdef LOG_MAKEPRI - RETVAL = LOG_MAKEPRI(fac,pri); -#else - croak("Your vendor has not defined the Sys::Syslog macro LOG_MAKEPRI"); - RETVAL = -1; -#endif - OUTPUT: - RETVAL int LOG_MASK(pri) INPUT: int pri - CODE: -#ifdef LOG_MASK - RETVAL = LOG_MASK(pri); -#else - croak("Your vendor has not defined the Sys::Syslog macro LOG_MASK"); - RETVAL = -1; -#endif - OUTPUT: - RETVAL int LOG_UPTO(pri) INPUT: int pri - CODE: -#ifdef LOG_UPTO - RETVAL = LOG_UPTO(pri); -#else - croak("Your vendor has not defined the Sys::Syslog macro LOG_UPTO"); - RETVAL = -1; -#endif - OUTPUT: - RETVAL #ifdef HAVE_SYSLOG @@ -136,10 +121,18 @@ setlogmask_xs(mask) void closelog_xs() + PREINIT: + U32 refcnt; CODE: + if (!ident_svptr) + return; closelog(); - if (SvREFCNT(ident_svptr)) + refcnt = SvREFCNT(ident_svptr); + if (refcnt) { SvREFCNT_dec(ident_svptr); + if (refcnt == 1) + ident_svptr = NULL; + } #else /* HAVE_SYSLOG */ diff --git a/cpan/Sys-Syslog/t/constants.t b/cpan/Sys-Syslog/t/constants.t index 5ebfe6d..847c773 100644 --- a/cpan/Sys-Syslog/t/constants.t +++ b/cpan/Sys-Syslog/t/constants.t @@ -3,7 +3,6 @@ use strict; use File::Spec; use Test::More; -# NB. For PERL_CORE to be set, taint mode must not be enabled my $macrosall = 'macros.all'; open(MACROS, $macrosall) or plan skip_all => "can't read '$macrosall': $!"; my @names = map {chomp;$_} ; diff --git a/cpan/Sys-Syslog/t/syslog.t b/cpan/Sys-Syslog/t/syslog.t index 0b7a9c4..ee136d5 100644 --- a/cpan/Sys-Syslog/t/syslog.t +++ b/cpan/Sys-Syslog/t/syslog.t @@ -45,13 +45,25 @@ BEGIN { $tests += 1 } can_ok( 'Sys::Syslog' => qw(openlog syslog syslog setlogmask setlogsock closelog) ); -BEGIN { $tests += 1 } +BEGIN { $tests += 4 } # check the diagnostics # setlogsock() eval { setlogsock() }; -like( $@, qr/^Invalid argument passed to setlogsock/, +like( $@, qr/^setlogsock\(\): Invalid number of arguments/, "calling setlogsock() with no argument" ); +eval { setlogsock(undef) }; +like( $@, qr/^setlogsock\(\): Invalid type; must be one of /, + "calling setlogsock() with undef" ); + +eval { setlogsock(\"") }; +like( $@, qr/^setlogsock\(\): Unexpected scalar reference/, + "calling setlogsock() with a scalar reference" ); + +eval { setlogsock({}) }; +like( $@, qr/^setlogsock\(\): No argument given/, + "calling setlogsock() with an empty hash reference" ); + BEGIN { $tests += 3 } # syslog() eval { syslog() }; diff --git a/cpan/Sys-Syslog/win32/PerlLog.mc b/cpan/Sys-Syslog/win32/PerlLog.mc index 3a7c1fd..e1e06b37 100644 --- a/cpan/Sys-Syslog/win32/PerlLog.mc +++ b/cpan/Sys-Syslog/win32/PerlLog.mc @@ -1,602 +1,602 @@ -; // Sys::Syslog Message File 1.0.0 - -MessageIdTypedef = DWORD - -SeverityNames = ( - Success = 0x0:STATUS_SEVERITY_SUCCESS - Informational = 0x1:STATUS_SEVERITY_INFORMATIONAL - Warning = 0x2:STATUS_SEVERITY_WARNING - Error = 0x3:STATUS_SEVERITY_ERROR -) - -LanguageNames = ( English = 0x0409:MSG00409 ) -LanguageNames = ( French = 0x040C:MSG0040C ) - - -; // ================================================================= -; // The following are facility name definitions - -MessageId = 0x0001 -SymbolicName = CAT_KERN -Language = English -Kernel -. -Language = French -Kernel -. - -MessageId = 0x0002 -SymbolicName = CAT_USER -Language = English -User -. -Language = French -User -. - -MessageId = 0x0003 -SymbolicName = CAT_MAIL -Language = English -Mail -. -Language = French -Mail -. - -MessageId = 0x0004 -SymbolicName = CAT_DAEMON -Language = English -Daemon -. -Language = French -Daemon -. - -MessageId = 0x0005 -SymbolicName = CAT_AUTH -Language = English -Auth -. -Language = French -Auth -. - -MessageId = 0x0006 -SymbolicName = CAT_SYSLOG -Language = English -Syslog -. -Language = French -Syslog -. - -MessageId = 0x0007 -SymbolicName = CAT_LPR -Language = English -LPR -. -Language = French -LPR -. - -MessageId = 0x0008 -SymbolicName = CAT_NEWS -Language = English -News -. -Language = French -News -. - -MessageId = 0x0009 -SymbolicName = CAT_UUCP -Language = English -UUCP -. -Language = French -UUCP -. - -MessageId = 0x000a -SymbolicName = CAT_CRON -Language = English -Cron -. -Language = French -Cron -. - -MessageId = 0x000b -SymbolicName = CAT_AUTHPRIV -Language = English -AuthPrivate -. -Language = French -AuthPrivate -. - -MessageId = 0x000c -SymbolicName = CAT_FTP -Language = English -FTP -. -Language = French -FTP -. - -MessageId = 0x000d -SymbolicName = CAT_LOCAL0 -Language = English -Local0 -. -Language = French -Local0 -. - -MessageId = 0x000e -SymbolicName = CAT_LOCAL1 -Language = English -Local1 -. -Language = French -Local1 -. - -MessageId = 0x000f -SymbolicName = CAT_LOCAL2 -Language = English -Local2 -. -Language = French -Local2 -. - -MessageId = 0x0010 -SymbolicName = CAT_LOCAL3 -Language = English -Local3 -. -Language = French -Local3 -. - -MessageId = 0x0011 -SymbolicName = CAT_LOCAL4 -Language = English -Local4 -. -Language = French -Local4 -. - -MessageId = 0x0012 -SymbolicName = CAT_LOCAL5 -Language = English -Local5 -. -Language = French -Local5 -. - -MessageId = 0x0013 -SymbolicName = CAT_LOCAL6 -Language = English -Local6 -. -Language = French -Local6 -. - -MessageId = 0x0014 -SymbolicName = CAT_LOCAL7 -Language = English -Local7 -. -Language = French -Local7 -. - -; // Mac OS X specific facilities ------------------------------------ - -MessageId = 0x0015 -SymbolicName = CAT_NETINFO -Language = English -NetInfo -. -Language = French -NetInfo -. - -MessageId = 0x0016 -SymbolicName = CAT_REMOTEAUTH -Language = English -RemoteAuth -. -Language = French -RemoteAuth -. - -MessageId = 0x0017 -SymbolicName = CAT_RAS -Language = English -RAS -. -Language = French -RAS -. - -MessageId = 0x0018 -SymbolicName = CAT_INSTALL -Language = English -Install -. -Language = French -Install -. - -MessageId = 0x0019 -SymbolicName = CAT_LAUNCHD -Language = English -Launchd -. -Language = French -Launchd -. - -; //modern BSD specific facilities ---------------------------------- - -MessageId = 0x001a -SymbolicName = CAT_CONSOLE -Language = English -Console -. -Language = French -Console -. - -MessageId = 0x001b -SymbolicName = CAT_NTP -Language = English -NTP -. -Language = French -NTP -. - -MessageId = 0x001c -SymbolicName = CAT_SECURITY -Language = English -Security -. -Language = French -Sécurité -. - -; // IRIX specific facilities ---------------------------------------- - -MessageId = 0x001d -SymbolicName = CAT_AUDIT -Language = English -Audit -. -Language = French -Audit -. - -MessageId = 0x001e -SymbolicName = CAT_LFMT -Language = English -LogAlert -. -Language = French -LogAlert -. - - -; // ================================================================= -; // The following are message definitions. - -MessageId = 0x0080 -SymbolicName = MSG_KERNEL -Language = English -Kernel message: %1 -. -Language = French -Message du noyau : %1 -. - - -MessageId = 0x0081 -SymbolicName = MSG_USER -Language = English -User message: %1 -. -Language = French -Message utilisateur : %1 -. - - -MessageId = 0x0082 -SymbolicName = MSG_MAIL -Language = English -Mail subsystem message: %1 -. -Language = French -Message du sous-système de courrier : %1 -. - - -MessageId = 0x0083 -SymbolicName = MSG_DAEMON -Language = English -Message from a system daemon without separate facility value: %1 -. -Language = French -Message d'un daemon sans catégorie spécifique : %1 -. - - -MessageId = 0x0084 -SymbolicName = MSG_AUTH -Language = English -Security/authorization message: %1 -. -Language = French -Message de sécurite ou d'authorisation : %1 -. - - -MessageId = 0x0085 -SymbolicName = MSG_SYSLOG -Language = English -Message generated internally by syslogd: %1 -. -Language = French -Message interne généré par le daemon syslogd : %1 -. - - -MessageId = 0x0086 -SymbolicName = MSG_LPR -Language = English -Line printer subsystem message: %1 -. -Language = French -Message du sous-système d'impression : %1 -. - - -MessageId = 0x0087 -SymbolicName = MSG_NEWS -Language = English -USENET news subsystem message: %1 -. -Language = French -Message du sous-système de nouvelles USENET : %1 -. - - -MessageId = 0x0088 -SymbolicName = MSG_UUCP -Language = English -UUCP subsystem message: %1 -. -Language = French -Message du sous-système UUCP : %1 -. - - -MessageId = 0x0089 -SymbolicName = MSG_CRON -Language = English -Message generated by the clock daemons (cron and at): %1 -. -Language = French -Message généré par les daemons d'exécution programmée (cron et at) : %1 -. - - -MessageId = 0x008A -SymbolicName = MSG_AUTHPRIV -Language = English -Security or authorization private message: %1 -. -Language = French -Message privé de sécurité ou d'authorisation : %1 -. - - -MessageId = 0x008B -SymbolicName = MSG_FTP -Language = English -FTP daemon message: %1 -. -Language = French -Message du daemon FTP : %1 -. - - -MessageId = 0x008C -SymbolicName = MSG_LOCAL0 -Language = English -Local message on channel 0: %1 -. -Language = French -Message local sur le canal 0 : %1 -. - - -MessageId = 0x008D -SymbolicName = MSG_LOCAL1 -Language = English -Local message on channel 1: %1 -. -Language = French -Message local sur le canal 1 : %1 -. - - -MessageId = 0x008E -SymbolicName = MSG_LOCAL2 -Language = English -Local message on channel 2: %1 -. -Language = French -Message local sur le canal 2 : %1 -. - - -MessageId = 0x008F -SymbolicName = MSG_LOCAL3 -Language = English -Local message on channel 3: %1 -. -Language = French -Message local sur le canal 3 : %1 -. - - -MessageId = 0x0090 -SymbolicName = MSG_LOCAL4 -Language = English -Local message on channel 4: %1 -. -Language = French -Message local sur le canal 4 : %1 -. - - -MessageId = 0x0091 -SymbolicName = MSG_LOCAL5 -Language = English -Local message on channel 5: %1 -. -Language = French -Message local sur le canal 5 : %1 -. - - -MessageId = 0x0092 -SymbolicName = MSG_LOCAL6 -Language = English -Local message on channel 6: %1 -. -Language = French -Message local sur le canal 6 : %1 -. - - -MessageId = 0x0093 -SymbolicName = MSG_LOCAL7 -Language = English -Local message on channel 7: %1 -. -Language = French -Message local sur le canal 7 : %1 -. - - -; // Mac OS X specific facilities ------------------------------------ - -MessageId = 0x0094 -SymbolicName = MSG_NETINFO -Language = English -NetInfo subsystem message: %1 -. -Language = French -Message du sous-système NetInfo : %1 -. - - -MessageId = 0x0095 -SymbolicName = MSG_REMOTEAUTH -Language = English -Remote authentication or authorization message: %1 -. -Language = French -Message d'authentification ou d'authorisation distante : %1 -. - - -MessageId = 0x0096 -SymbolicName = MSG_RAS -Language = English -Message generated by the Remote Access Service (VPN / PPP): %1 -. -Language = French -Message généré par le Service d'Accès Distant (Remote Access Service) (VPN / PPP) : %1 -. - - -MessageId = 0x0097 -SymbolicName = MSG_INSTALL -Language = English -Installer subsystem message: %1 -. -Language = French -Message du sous-système d'installation : %1 -. - - -MessageId = 0x0098 -SymbolicName = MSG_LAUNCHD -Language = English -Message generated by launchd, the general bootstrap daemon: %1 -. -Language = French -Message généré par launchd, le daemon générique de démarrage : %1 -. - -; //modern BSD specific facilities ---------------------------------- - -MessageId = 0x0099 -SymbolicName = MSG_CONSOLE -Language = English -Message for the console: %1 -. -Language = French -Message pour la console : %1 -. - - -MessageId = 0x009a -SymbolicName = MSG_NTP -Language = English -NTP subsystem message: %1 -. -Language = French -Message du sous-système NTP : %1 -. - - -MessageId = 0x009b -SymbolicName = MSG_SECURITY -Language = English -Security subsystem message (firewalling, etc.): %1 -. -Language = French -Message du sous-système de sécurité (pare-feu, etc.) : %1 -. - - -; // IRIX specific facilities ---------------------------------------- - -MessageId = 0x009c -SymbolicName = MSG_AUDIT -Language = English -Audit daemon message: %1 -. -Language = French -Message du daemon d'audit NTP : %1 -. - - -MessageId = 0x009d -SymbolicName = MSG_LFMT -Language = English -Logalert facility: %1 -. -Language = French -Message de logalert : %1 -. - +; // Sys::Syslog Message File 1.0.0 + +MessageIdTypedef = DWORD + +SeverityNames = ( + Success = 0x0:STATUS_SEVERITY_SUCCESS + Informational = 0x1:STATUS_SEVERITY_INFORMATIONAL + Warning = 0x2:STATUS_SEVERITY_WARNING + Error = 0x3:STATUS_SEVERITY_ERROR +) + +LanguageNames = ( English = 0x0409:MSG00409 ) +LanguageNames = ( French = 0x040C:MSG0040C ) + + +; // ================================================================= +; // The following are facility name definitions + +MessageId = 0x0001 +SymbolicName = CAT_KERN +Language = English +Kernel +. +Language = French +Kernel +. + +MessageId = 0x0002 +SymbolicName = CAT_USER +Language = English +User +. +Language = French +User +. + +MessageId = 0x0003 +SymbolicName = CAT_MAIL +Language = English +Mail +. +Language = French +Mail +. + +MessageId = 0x0004 +SymbolicName = CAT_DAEMON +Language = English +Daemon +. +Language = French +Daemon +. + +MessageId = 0x0005 +SymbolicName = CAT_AUTH +Language = English +Auth +. +Language = French +Auth +. + +MessageId = 0x0006 +SymbolicName = CAT_SYSLOG +Language = English +Syslog +. +Language = French +Syslog +. + +MessageId = 0x0007 +SymbolicName = CAT_LPR +Language = English +LPR +. +Language = French +LPR +. + +MessageId = 0x0008 +SymbolicName = CAT_NEWS +Language = English +News +. +Language = French +News +. + +MessageId = 0x0009 +SymbolicName = CAT_UUCP +Language = English +UUCP +. +Language = French +UUCP +. + +MessageId = 0x000a +SymbolicName = CAT_CRON +Language = English +Cron +. +Language = French +Cron +. + +MessageId = 0x000b +SymbolicName = CAT_AUTHPRIV +Language = English +AuthPrivate +. +Language = French +AuthPrivate +. + +MessageId = 0x000c +SymbolicName = CAT_FTP +Language = English +FTP +. +Language = French +FTP +. + +MessageId = 0x000d +SymbolicName = CAT_LOCAL0 +Language = English +Local0 +. +Language = French +Local0 +. + +MessageId = 0x000e +SymbolicName = CAT_LOCAL1 +Language = English +Local1 +. +Language = French +Local1 +. + +MessageId = 0x000f +SymbolicName = CAT_LOCAL2 +Language = English +Local2 +. +Language = French +Local2 +. + +MessageId = 0x0010 +SymbolicName = CAT_LOCAL3 +Language = English +Local3 +. +Language = French +Local3 +. + +MessageId = 0x0011 +SymbolicName = CAT_LOCAL4 +Language = English +Local4 +. +Language = French +Local4 +. + +MessageId = 0x0012 +SymbolicName = CAT_LOCAL5 +Language = English +Local5 +. +Language = French +Local5 +. + +MessageId = 0x0013 +SymbolicName = CAT_LOCAL6 +Language = English +Local6 +. +Language = French +Local6 +. + +MessageId = 0x0014 +SymbolicName = CAT_LOCAL7 +Language = English +Local7 +. +Language = French +Local7 +. + +; // Mac OS X specific facilities ------------------------------------ + +MessageId = 0x0015 +SymbolicName = CAT_NETINFO +Language = English +NetInfo +. +Language = French +NetInfo +. + +MessageId = 0x0016 +SymbolicName = CAT_REMOTEAUTH +Language = English +RemoteAuth +. +Language = French +RemoteAuth +. + +MessageId = 0x0017 +SymbolicName = CAT_RAS +Language = English +RAS +. +Language = French +RAS +. + +MessageId = 0x0018 +SymbolicName = CAT_INSTALL +Language = English +Install +. +Language = French +Install +. + +MessageId = 0x0019 +SymbolicName = CAT_LAUNCHD +Language = English +Launchd +. +Language = French +Launchd +. + +; //modern BSD specific facilities ---------------------------------- + +MessageId = 0x001a +SymbolicName = CAT_CONSOLE +Language = English +Console +. +Language = French +Console +. + +MessageId = 0x001b +SymbolicName = CAT_NTP +Language = English +NTP +. +Language = French +NTP +. + +MessageId = 0x001c +SymbolicName = CAT_SECURITY +Language = English +Security +. +Language = French +Sécurité +. + +; // IRIX specific facilities ---------------------------------------- + +MessageId = 0x001d +SymbolicName = CAT_AUDIT +Language = English +Audit +. +Language = French +Audit +. + +MessageId = 0x001e +SymbolicName = CAT_LFMT +Language = English +LogAlert +. +Language = French +LogAlert +. + + +; // ================================================================= +; // The following are message definitions. + +MessageId = 0x0080 +SymbolicName = MSG_KERNEL +Language = English +Kernel message: %1 +. +Language = French +Message du noyau : %1 +. + + +MessageId = 0x0081 +SymbolicName = MSG_USER +Language = English +User message: %1 +. +Language = French +Message utilisateur : %1 +. + + +MessageId = 0x0082 +SymbolicName = MSG_MAIL +Language = English +Mail subsystem message: %1 +. +Language = French +Message du sous-système de courrier : %1 +. + + +MessageId = 0x0083 +SymbolicName = MSG_DAEMON +Language = English +Message from a system daemon without separate facility value: %1 +. +Language = French +Message d'un daemon sans catégorie spécifique : %1 +. + + +MessageId = 0x0084 +SymbolicName = MSG_AUTH +Language = English +Security/authorization message: %1 +. +Language = French +Message de sécurite ou d'authorisation : %1 +. + + +MessageId = 0x0085 +SymbolicName = MSG_SYSLOG +Language = English +Message generated internally by syslogd: %1 +. +Language = French +Message interne généré par le daemon syslogd : %1 +. + + +MessageId = 0x0086 +SymbolicName = MSG_LPR +Language = English +Line printer subsystem message: %1 +. +Language = French +Message du sous-système d'impression : %1 +. + + +MessageId = 0x0087 +SymbolicName = MSG_NEWS +Language = English +USENET news subsystem message: %1 +. +Language = French +Message du sous-système de nouvelles USENET : %1 +. + + +MessageId = 0x0088 +SymbolicName = MSG_UUCP +Language = English +UUCP subsystem message: %1 +. +Language = French +Message du sous-système UUCP : %1 +. + + +MessageId = 0x0089 +SymbolicName = MSG_CRON +Language = English +Message generated by the clock daemons (cron and at): %1 +. +Language = French +Message généré par les daemons d'exécution programmée (cron et at) : %1 +. + + +MessageId = 0x008A +SymbolicName = MSG_AUTHPRIV +Language = English +Security or authorization private message: %1 +. +Language = French +Message privé de sécurité ou d'authorisation : %1 +. + + +MessageId = 0x008B +SymbolicName = MSG_FTP +Language = English +FTP daemon message: %1 +. +Language = French +Message du daemon FTP : %1 +. + + +MessageId = 0x008C +SymbolicName = MSG_LOCAL0 +Language = English +Local message on channel 0: %1 +. +Language = French +Message local sur le canal 0 : %1 +. + + +MessageId = 0x008D +SymbolicName = MSG_LOCAL1 +Language = English +Local message on channel 1: %1 +. +Language = French +Message local sur le canal 1 : %1 +. + + +MessageId = 0x008E +SymbolicName = MSG_LOCAL2 +Language = English +Local message on channel 2: %1 +. +Language = French +Message local sur le canal 2 : %1 +. + + +MessageId = 0x008F +SymbolicName = MSG_LOCAL3 +Language = English +Local message on channel 3: %1 +. +Language = French +Message local sur le canal 3 : %1 +. + + +MessageId = 0x0090 +SymbolicName = MSG_LOCAL4 +Language = English +Local message on channel 4: %1 +. +Language = French +Message local sur le canal 4 : %1 +. + + +MessageId = 0x0091 +SymbolicName = MSG_LOCAL5 +Language = English +Local message on channel 5: %1 +. +Language = French +Message local sur le canal 5 : %1 +. + + +MessageId = 0x0092 +SymbolicName = MSG_LOCAL6 +Language = English +Local message on channel 6: %1 +. +Language = French +Message local sur le canal 6 : %1 +. + + +MessageId = 0x0093 +SymbolicName = MSG_LOCAL7 +Language = English +Local message on channel 7: %1 +. +Language = French +Message local sur le canal 7 : %1 +. + + +; // Mac OS X specific facilities ------------------------------------ + +MessageId = 0x0094 +SymbolicName = MSG_NETINFO +Language = English +NetInfo subsystem message: %1 +. +Language = French +Message du sous-système NetInfo : %1 +. + + +MessageId = 0x0095 +SymbolicName = MSG_REMOTEAUTH +Language = English +Remote authentication or authorization message: %1 +. +Language = French +Message d'authentification ou d'authorisation distante : %1 +. + + +MessageId = 0x0096 +SymbolicName = MSG_RAS +Language = English +Message generated by the Remote Access Service (VPN / PPP): %1 +. +Language = French +Message généré par le Service d'Accès Distant (Remote Access Service) (VPN / PPP) : %1 +. + + +MessageId = 0x0097 +SymbolicName = MSG_INSTALL +Language = English +Installer subsystem message: %1 +. +Language = French +Message du sous-système d'installation : %1 +. + + +MessageId = 0x0098 +SymbolicName = MSG_LAUNCHD +Language = English +Message generated by launchd, the general bootstrap daemon: %1 +. +Language = French +Message généré par launchd, le daemon générique de démarrage : %1 +. + +; //modern BSD specific facilities ---------------------------------- + +MessageId = 0x0099 +SymbolicName = MSG_CONSOLE +Language = English +Message for the console: %1 +. +Language = French +Message pour la console : %1 +. + + +MessageId = 0x009a +SymbolicName = MSG_NTP +Language = English +NTP subsystem message: %1 +. +Language = French +Message du sous-système NTP : %1 +. + + +MessageId = 0x009b +SymbolicName = MSG_SECURITY +Language = English +Security subsystem message (firewalling, etc.): %1 +. +Language = French +Message du sous-système de sécurité (pare-feu, etc.) : %1 +. + + +; // IRIX specific facilities ---------------------------------------- + +MessageId = 0x009c +SymbolicName = MSG_AUDIT +Language = English +Audit daemon message: %1 +. +Language = French +Message du daemon d'audit NTP : %1 +. + + +MessageId = 0x009d +SymbolicName = MSG_LFMT +Language = English +Logalert facility: %1 +. +Language = French +Message de logalert : %1 +. + diff --git a/cpan/Sys-Syslog/win32/PerlLog_dll.uu b/cpan/Sys-Syslog/win32/PerlLog_dll.uu index 2661a9c..3bb5ff5 100644 --- a/cpan/Sys-Syslog/win32/PerlLog_dll.uu +++ b/cpan/Sys-Syslog/win32/PerlLog_dll.uu @@ -1,171 +1,171 @@ -M35J0``,````$````__\``+@`````````0``````````````````````````` -M````````````````````L`````X?N@X`M`G-(;@!3,TA5&AI\6B=K+4XDX[6Z)VLM3B5)I8VC;RU.)``````````!010`` -M3`$"`!LK3D4``````````.``#B$+`0<````````<```````````````0```` -M$```````8``0`````@``!``````````$``````````!``````@``IAX```(` -M`````!```!``````$```$````````!```````````````````````````!`` -M`+`8`````````````````````````#````@````````````````````````` -M```````````````````````````````````````````````````````````` -M`````````````````````````"YR`"8`V,`=0!T -M`&D`;P!N`"``<`!R`&\`9P!R`&$`;0!M`)@#90`@`"@`8P!R`&\`;@`@`&4` -M=``@`&$`=``I`"``.@`@`"4`,0`-``H```!L``$`30!E`',`0!S`&P`;P!G``T`"@`````` -M$``!`$P`4`!2``T`"@```!0``0!.`&4`=P!S``T`"@``````%``!`%4`50!# -M`%``#0`*```````4``$`0P!R`&\`;@`-``H``````"```0!!`'4`=`!H`%`` -M<@!I`'8`80!T`&4`#0`*````$``!`$8`5`!0``T`"@```!@``0!,`&\`8P!A -M`&P`,``-``H``````!@``0!,`&\`8P!A`&P`,0`-``H``````!@``0!,`&\` -M8P!A`&P`,@`-``H``````!@``0!,`&\`8P!A`&P`,P`-``H``````!@``0!, -M`&\`8P!A`&P`-``-``H``````!@``0!,`&\`8P!A`&P`-0`-``H``````!@` -M`0!,`&\`8P!A`&P`-@`-``H``````!@``0!,`&\`8P!A`&P`-P`-``H````` -M`!@``0!.`&4`=`!)`&X`9@!O``T`"@```"```0!2`&4`;0!O`'0`90!!`'4` -M=`!H``T`"@``````$``!`%(`00!3``T`"@```!@``0!)`&X`0`@`'8`80!L`'4`90`Z`"`` -M)0`Q``T`"@``````4``!`%,`90!C`'4`<@!I`'0`>0`O`&$`=0!T`&@`;P!R -M`&D`>@!A`'0`:0!O`&X`(`!M`&4`0`@`&(`>0`@`',`>0!S`&P`;P!G`&0`.@`@`"4` -M,0`-``H```!0``$`3`!I`&X`90`@`'``<@!I`&X`=`!E`'(`(`!S`'4`8@!S -M`'D`0!S`'0`90!M`"``;0!E`',`0`@`'0`:`!E`"``8P!L`&\`8P!K`"``9`!A`&4`;0!O`&X````````````````````````````````````````` +M35J0``,````$````__\``+@`````````0``````````````````````````` +M````````````````````L`````X?N@X`M`G-(;@!3,TA5&AI\6B=K+4XDX[6Z)VLM3B5)I8VC;RU.)``````````!010`` +M3`$"`!LK3D4``````````.``#B$+`0<````````<```````````````0```` +M$```````8``0`````@``!``````````$``````````!``````@``IAX```(` +M`````!```!``````$```$````````!```````````````````````````!`` +M`+`8`````````````````````````#````@````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````"YR`"8`V,`=0!T +M`&D`;P!N`"``<`!R`&\`9P!R`&$`;0!M`)@#90`@`"@`8P!R`&\`;@`@`&4` +M=``@`&$`=``I`"``.@`@`"4`,0`-``H```!L``$`30!E`',`0!S`&P`;P!G``T`"@`````` +M$``!`$P`4`!2``T`"@```!0``0!.`&4`=P!S``T`"@``````%``!`%4`50!# +M`%``#0`*```````4``$`0P!R`&\`;@`-``H``````"```0!!`'4`=`!H`%`` +M<@!I`'8`80!T`&4`#0`*````$``!`$8`5`!0``T`"@```!@``0!,`&\`8P!A +M`&P`,``-``H``````!@``0!,`&\`8P!A`&P`,0`-``H``````!@``0!,`&\` +M8P!A`&P`,@`-``H``````!@``0!,`&\`8P!A`&P`,P`-``H``````!@``0!, +M`&\`8P!A`&P`-``-``H``````!@``0!,`&\`8P!A`&P`-0`-``H``````!@` +M`0!,`&\`8P!A`&P`-@`-``H``````!@``0!,`&\`8P!A`&P`-P`-``H````` +M`!@``0!.`&4`=`!)`&X`9@!O``T`"@```"```0!2`&4`;0!O`'0`90!!`'4` +M=`!H``T`"@``````$``!`%(`00!3``T`"@```!@``0!)`&X`0`@`'8`80!L`'4`90`Z`"`` +M)0`Q``T`"@``````4``!`%,`90!C`'4`<@!I`'0`>0`O`&$`=0!T`&@`;P!R +M`&D`>@!A`'0`:0!O`&X`(`!M`&4`0`@`&(`>0`@`',`>0!S`&P`;P!G`&0`.@`@`"4` +M,0`-``H```!0``$`3`!I`&X`90`@`'``<@!I`&X`=`!E`'(`(`!S`'4`8@!S +M`'D`0!S`'0`90!M`"``;0!E`',`0`@`'0`:`!E`"``8P!L`&\`8P!K`"``9`!A`&4`;0!O`&X`````````````````````````````````````````