Date: Tue, 23 Jul 2002 18:19:24 -0700 (PDT) From: Berry Kercheval <berry@panasas.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/40941: syslogd "!prog" fails for progs with non-alphanumeric characters. Message-ID: <200207240119.g6O1JOgt049532@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 40941 >Category: misc >Synopsis: syslogd "!prog" fails for progs with non-alphanumeric characters. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 23 18:20:01 PDT 2002 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207240119.g6O1JOgt049532>