From nobody@FreeBSD.org  Tue Jul 23 18:19:25 2002
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 2F0AD37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Jul 2002 18:19:25 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B37D843E3B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Jul 2002 18:19:24 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g6O1JOOT049533
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Jul 2002 18:19:24 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g6O1JOgt049532;
	Tue, 23 Jul 2002 18:19:24 -0700 (PDT)
Message-Id: <200207240119.g6O1JOgt049532@www.freebsd.org>
Date: Tue, 23 Jul 2002 18:19:24 -0700 (PDT)
From: Berry Kercheval <berry@panasas.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: syslogd "!prog" fails for progs with non-alphanumeric characters.
X-Send-Pr-Version: www-1.0

>Number:         40941
>Category:       misc
>Synopsis:       syslogd "!prog" fails for progs with non-alphanumeric characters.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    robert
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 23 18:20:01 PDT 2002
>Closed-Date:    Wed Jul 09 13:44:50 PDT 2003
>Last-Modified:  Wed Jul 09 13:44:50 PDT 2003
>Originator:     Berry Kercheval
>Release:        4.6
>Organization:
Panasas Inc.
>Environment:
Found in 4.3 but still present in 4.6
>Description:
The syslogd configuration file allows the "!prog" syntax to route messages from progam "prog" to various logging facilitys.  If the name of the program "prog" has other than alphanumerics in it, then the name is truncated at the first non-alphanumeric and any program that matches the 
shortened name will have its syslog messages routed as though it were that program.
>How-To-Repeat:
     Create a syslog.conf with, for example:

!prog_one
*.*          /var/log/prog_one.log
!prog_two
*.*          /var/log/prog_two.log

and then run programs called "prog_one" and "prog_two" that do syslog action.  Observe that each program's syslog messages appear in EACH log file.
>Fix:
Around line 1460 of src/usr/sbin/syslogd/syslogd.c, change

-		if (!isalnum(p[i]))

to

+   	        if (isspace(p[i]))

and the name after the '!' will be copied up to the space, tab or newline that follows it, instead of stopping at a '_', '-' or '.'.  

Really, this won't allow commands with spaces in their names either (which are legal filenames, if hard to type) so it's not a perfect solution.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->robert 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Sun Jul 28 06:26:09 PDT 2002 
Responsible-Changed-Why:  
Robert Drehmel has been dealing with this problem. 

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

From: Lukas Ertl <l.ertl@univie.ac.at>
To: freebsd-gnats-submit@FreeBSD.org, berry@panasas.com
Cc:  
Subject: Re: misc/40941: syslogd "!prog" fails for progs with non-alphanumeric
 characters.
Date: Wed, 9 Jul 2003 21:38:31 +0200 (CEST)

 Hi,
 
 this is fixed in -current and -stable, so this PR can be closed.
 
 regards,
 le
 
 --=20
 Lukas Ertl                             eMail: l.ertl@univie.ac.at
 UNIX-Systemadministrator               Tel.:  (+43 1) 4277-14073
 Zentraler Informatikdienst (ZID)       Fax.:  (+43 1) 4277-9140
 der Universit=E4t Wien                   http://mailbox.univie.ac.at/~le/
State-Changed-From-To: open->closed 
State-Changed-By: robert 
State-Changed-When: Wed Jul 9 13:39:02 PDT 2003 
State-Changed-Why:  
Patched (although with a non-perfect solution*) in -STABLE 
and -CURRENT. 

*'[' and ':' are still not working correctly in names of 
executables as both are used as delimiters in the protocol. 

Reminded by: Lukas Ertl <l.ertl@univie.ac.at> 

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