Bug in syslog(3) in 4.2BSD (with fix).

Stephen J. Muir stephen at comp.lancs.ac.uk
Mon Aug 4 10:03:15 AEST 1986


Index:	lib/libc/gen/syslog.c 4.2 Fix

Description:
	syslog(3) fails when a %c (where c != 'm') occurs in the string
Repeat-By:
	use the following call:

	syslog ("%s: %m", "filename");

	The string is truncated after the "%s" and no newline is added.  The
	next call to syslog() (even from another program) will tack it's output
	onto the same line as the previous and be processed as one.

Fix:
	apply the following patch to /usr/src/lib/libc/gen/syslog.c
73c73
< 				*b++ = '%', *b++ = c, *b++ = '\0';
---
> 				*b++ = '%', *b++ = c;

-- 
EMAIL:	stephen at comp.lancs.ac.uk	| Post: University of Lancaster,
UUCP:	...!mcvax!ukc!dcl-cs!stephen	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4120		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR



More information about the Comp.bugs.4bsd.ucb-fixes mailing list