[syslog-ng]Re: syslog-ng bug: newlines in messages
Balazs Scheidler
bazsi@balabit.hu
Sun, 27 Aug 2000 15:39:55 +0200
> If a syslogged message contains a newline, syslog-ng writes the
> message with the newline still embedded. This plays havoc with syslog
> parsing. Other syslogd implementations replace the newline with
> something else (ie. a space.) bind-8.2.2P5, on startup, logs a
> message that contains an embedded newline. The Linux kernel also
> occasionally logs messages that contain newlines.
I've just comitted a fix, it should be available in the next version, or
apply this patch:
diff -u -r1.19 log.c
--- log.c 2000/03/01 22:02:47 1.19
+++ log.c 2000/08/27 13:39:32
@@ -155,6 +155,9 @@
lm->stamp = now;
}
+ for (oldsrc = src, oldleft = left; oldleft; oldleft--, oldsrc++) {
+ if (*oldsrc < 32) *oldsrc = '.';
+ }
lm->msg = c_format_cstring("%s", left, src);
}
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
url: http://www.balabit.hu/pgpkey.txt