From nobody@FreeBSD.org  Mon Jul  5 13:10:52 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6710116A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Jul 2004 13:10:52 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5FD6943D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  5 Jul 2004 13:10:52 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i65DAp8J082699
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 5 Jul 2004 13:10:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i65DAp8A082698;
	Mon, 5 Jul 2004 13:10:51 GMT
	(envelope-from nobody)
Message-Id: <200407051310.i65DAp8A082698@www.freebsd.org>
Date: Mon, 5 Jul 2004 13:10:51 GMT
From: Markus Oestreicher <m.oe@x-trader.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: syslogd - correct program name handling
X-Send-Pr-Version: www-2.3

>Number:         68691
>Category:       bin
>Synopsis:       syslogd - correct program name handling
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 05 13:20:22 GMT 2004
>Closed-Date:    Sun Jun 10 06:23:55 GMT 2007
>Last-Modified:  Sun Jun 10 06:23:55 GMT 2007
>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:
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Mon Jul 5 13:30:50 GMT 2004 
Responsible-Changed-Why:  
I'll have a look at this. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68691 
State-Changed-From-To: open->patched 
State-Changed-By: dwmalone 
State-Changed-When: Tue Dec 28 22:25:17 GMT 2004 
State-Changed-Why:  
This patch (and one other change) have been committed to -current. I'll 
MFC them in a few weeks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68691 

From: Matteo Riondato <rionda@gufi.org>
To: bug-followup@freebsd.org
Cc: dwmalone@freebsd.org
Subject: Re: bin/68691 syslogd - correct program name handling
Date: Fri, 8 Apr 2005 10:55:47 +0200

 --AqCDj3hiknadvR6t
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Could you please remember to MFC the fix to RELENG_5 and RELENG_4?
 (After that, this PR can be closed)
 Thanks
 Best Regards
 --=20
 Rionda aka Matteo Riondato
 Disinformato per default
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
 
 --AqCDj3hiknadvR6t
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (FreeBSD)
 
 iD8DBQFCVkcT2Mp4pR7Fa+wRAnLgAJ9vvxmeaVBHzHpm2f4t8GE1H+JAOQCgoGsI
 ppk1eHHPpfavhI1ED6y6R3U=
 =D2Ky
 -----END PGP SIGNATURE-----
 
 --AqCDj3hiknadvR6t--
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Jun 10 06:22:45 UTC 2007 
State-Changed-Why:  
RELENG_4 is now out of support.  While RELENG_5 is still supported, the 
fact that the MFC still hasn't been done probably indicates lack of interest. 

Hat:		bugmeister 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68691 
>Unformatted:
