From owner-freebsd-bugs Tue Jul 23 18:20: 7 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4C6D37B400 for ; Tue, 23 Jul 2002 18:20:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F3A343E5E for ; Tue, 23 Jul 2002 18:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6O1K2JU092603 for ; Tue, 23 Jul 2002 18:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6O1K2wR092602; Tue, 23 Jul 2002 18:20:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F0AD37B400 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/40941: syslogd "!prog" fails for progs with non-alphanumeric characters. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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