[syslog-ng][PATCH] please test: syslog-ng message mangling fix

Balazs Scheidler bazsi@balabit.hu
Thu, 8 Aug 2002 11:23:08 +0200


Hi,

This patch should fix the message mangling problems you might have
encountered. As the log parsing routines are quite critical I don't want to
release this patch without testing on most platforms. It seems to work on
Linux for me, but tests from more exotic platforms are welcome.

(the problem this patch fixes occurs only if you have messages longer than
the default limit. the limit can be changed by log_msg_size)

to test: apply the patch, and touch sources.c.x, and recompile

Index: sources.c
===================================================================
RCS file: /var/cvs/syslog-ng/syslog-ng/src/sources.c,v
retrieving revision 1.34
diff -u -r1.34 sources.c
--- sources.c	18 Jul 2002 13:18:02 -0000	1.34
+++ sources.c	8 Aug 2002 09:21:34 -0000
@@ -112,8 +113,8 @@
 		closure->pos = 0;
 		return ST_OK | ST_GOON;
 	}
-	if (!eol && closure->pos) {
-		/* we don't have a terminating nl nor \0 */
+	if (!eol && closure->pos == closure->max_log_line) {
+		/* we don't have a terminating nl nor \0, and our buffer is full */
 		do_handle_line(closure, closure->pos, closure->buffer, salen ? (abstract_addr *) &sabuf : NULL, salen);
 		closure->pos = 0;
 		return ST_OK | ST_GOON;

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1