-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-compliant Syslog UDP packets #7200
Comments
From lool@via.ecp.frCreated by lool@via.ecp.frHi, I experienced troubles with Perl-generated UDP Syslog messages and Here's a sample program doing UDP Syslog-ing: | #!/usr/bin/perl -w When tcpdumping the above (or strace-ing), one can see the datagrams Packets generated by a Linux or Solaris standard syslogd end in 0a The RFC 3164 doesn't recommend the use of a terminator, it seems While I understand it is preferable for the receiving party to handle Regards, -- Perl Info
|
From @iabynOn Sun, Mar 28, 2004 at 01:47:26PM -0000, Loc Minier wrote:
Looking at the history of this, perl Syslog has included the \n since at Title: "Sys::Syslog patch to allow unix domain sockets" which I guess must be the change in question, but I can't find anything Dave. -- |
The RT System itself - Status changed from 'new' to 'open' |
From lool@via.ecp.frDave Mitchell via RT <perlbug-followup@perl.org> - Wed, Mar 31, 2004:
I thik the \n is ok, it's included in most packets, only the BSD I understand you can be reluctant to change a possibly widely-used Regards, -- |
From @iabynOn Thu, Apr 01, 2004 at 09:56:48AM +0200, Loic Minier wrote:
My request for "further info" was aimed mainly at the old-timers on the Dave. -- |
From julian@mehnle.netpackage libmail-spf-query-perl John A. Martin wrote:
Julian Mehnle wrote:
Oh, it _has_ changed! See the attached diff of the Sys::Syslog changes in However it seems syslog-ng does not add its own newline when writing the There's probably another, similar issue with regard to adding NULL byte Although there seems to have been some reluctance by the Perl folks to omit If \0 terminators are indeed required with UNIX domain sockets (which I In any case, those are not bugs in libmail-spf-query-perl AKA Mail::SPF:: Julian. References: |
From julian@mehnle.net06_fix_syslog_null.diffRemove spurious \n and \0 terminators.
diff -Naur --exclude=debian perl-5.8.8.orig/ext/Sys/Syslog/Syslog.pm perl-5.8.8/ext/Sys/Syslog/Syslog.pm
--- perl-5.8.8.orig/ext/Sys/Syslog/Syslog.pm 2006-01-11 23:22:47.000000000 +1100
+++ perl-5.8.8/ext/Sys/Syslog/Syslog.pm 2006-02-11 11:59:14.000000000 +1100
@@ -676,15 +676,16 @@
$mask =~ s/(?<!%)((?:%%)*)%m/$1$err/g;
}
- $mask .= "\n" unless $mask =~ /\n$/;
$message = @_ ? sprintf($mask, @_) : $mask;
+ $message =~ s/[\r\n]+/ /g;
+ $message =~ s/ +$//;
$sum = $numpri + $numfac;
my $oldlocale = setlocale(LC_TIME);
setlocale(LC_TIME, 'C');
my $timestamp = strftime "%b %e %T", localtime;
setlocale(LC_TIME, $oldlocale);
- my $buf = "<$sum>$timestamp $whoami: $message\0";
+ my $buf = "<$sum>$timestamp $whoami: $message";
# it's possible that we'll get an error from sending
# (e.g. if method is UDP and there is no UDP listener,
@@ -724,7 +725,6 @@
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.
@@ -743,7 +743,7 @@
}
} else {
if (open(CONS, ">/dev/console")) {
- my $ret = print CONS $buf . "\r";
+ my $ret = print CONS $buf . "\r\n";
exit ($ret) if defined $pid;
close CONS;
}
|
From maddingue@free.frHello, Julian Mehnle wrote:
Just for the records, and as I see you still referring to RFC3164, I'll
This NULL byte was most probably added to be compatible with some given Best Regards, Sébastien Aperghis-Tramoni |
From julian@mehnle.netpackage syslog-ng Cleaning up bugs #356700 and #345157 in order to avoid any further Julian Mehnle. References: |
From odc@cpan.orgThis issue has been resolved since 2011 with Sys::Syslog v0.29 (Added options noeol and nonul). |
From @rjbsThanks, closed! -- |
@rjbs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#28019 (status was 'resolved')
Searchable as RT28019$
The text was updated successfully, but these errors were encountered: