Date: Mon, 5 Jul 2004 13:10:51 GMT From: Markus Oestreicher <m.oe@x-trader.de> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/68691: syslogd - correct program name handling Message-ID: <200407051310.i65DAp8A082698@www.freebsd.org> Resent-Message-ID: <200407051320.i65DKMAE079265@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 68691 >Category: misc >Synopsis: syslogd - correct program name handling >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 05 13:20:22 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Markus Oestreicher >Release: 4.10-STABLE #0: Mon Jul 5 10:02:52 GMT 2004 >Organization: >Environment: FreeBSD qhmail2.colt1.inetserver.de 4.10-STABLE FreeBSD 4.10-STABLE #0: Mon Jul 5 10:02:52 GMT 2004 root@qhmail2.colt1.inetserver.de:/usr >Description: A filter for a specific program name was not working. Looking at the source I found that the parsing routine does not stop when a white-space is found. So the whole line would be treated as program name which is wrong. >How-To-Repeat: The following syntax in syslog.conf didn't work: !PROGRAM *.* /path/to/file where as the corresponding log file looks like: Jul 5 15:03:29 hostname PROGRAM some logging text >Fix: Adding a check for a white-space to the list of abort criterias worked for me: *** syslogd.c.sik Mon Jul 5 14:53:09 2004 --- syslogd.c Mon Jul 5 14:54:18 2004 *************** *** 870,876 **** /* extract program name */ for (i = 0; i < NAME_MAX; i++) { if (!isprint(msg[i]) || msg[i] == ':' || msg[i] == '[' || ! msg[i] == '/') break; prog[i] = msg[i]; } --- 870,876 ---- /* extract program name */ for (i = 0; i < NAME_MAX; i++) { if (!isprint(msg[i]) || msg[i] == ':' || msg[i] == '[' || ! msg[i] == '/' || msg[i] == ' ') break; prog[i] = msg[i]; } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407051310.i65DAp8A082698>