From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 24 14:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07FBC106567B for ; Tue, 24 Jun 2008 14:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E08528FC1D for ; Tue, 24 Jun 2008 14:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5OEK2sd091690 for ; Tue, 24 Jun 2008 14:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5OEK2QN091689; Tue, 24 Jun 2008 14:20:02 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jun 2008 14:20:02 GMT Resent-Message-Id: <200806241420.m5OEK2QN091689@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andriy Pylypenko Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE79A1065677 for ; Tue, 24 Jun 2008 14:17:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A49918FC1B for ; Tue, 24 Jun 2008 14:17:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5OEHNEg002988 for ; Tue, 24 Jun 2008 14:17:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m5OEHNhv002987; Tue, 24 Jun 2008 14:17:23 GMT (envelope-from nobody) Message-Id: <200806241417.m5OEHNhv002987@www.freebsd.org> Date: Tue, 24 Jun 2008 14:17:23 GMT From: Andriy Pylypenko To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/124938: comments at the end of the line of the syslog.conf X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 14:20:03 -0000 >Number: 124938 >Category: bin >Synopsis: comments at the end of the line of the syslog.conf >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 24 14:20:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Andriy Pylypenko >Release: FreeBSD 6.3-STABLE i386 >Organization: Sippysoft Inc >Environment: FreeBSD sempron.sippysoft.com 6.3-STABLE FreeBSD 6.3-STABLE #1: Fri Feb 15 08:42:55 EET 2008 root@sempron.sippysoft.com:/usr/obj/usr/src/sys/BAMBY i386 >Description: Comments in the syslog.conf are supported almost anywhere except the end of the line of the selector specification. So the following line: cron.* /var/log/cron # cron messages means that the output file name is "/var/log/cron # cron messages" and not "/var/log/cron". >How-To-Repeat: >Fix: The following patch makes the syslogd to recognize and throw away comments at the end of the line of a the selector spec before stripping trailing whitespaces. I hope the compatibility with the old version of syslogd is not an issue as it is highly unlikely that some people use a file or a host names with embedded '#'. Patch attached with submission follows: --- src/usr.sbin/syslogd/syslogd.c.orig Tue Jun 24 16:24:10 2008 +++ src/usr.sbin/syslogd/syslogd.c Tue Jun 24 16:34:54 2008 @@ -1635,6 +1635,8 @@ prog[i] = 0; continue; } + if ((p = strchr(cline, '#')) != NULL) + *p = '\0'; for (i = strlen(cline) - 1; i >= 0 && isspace(cline[i]); i--) cline[i] = '\0'; f = (struct filed *)calloc(1, sizeof(*f)); >Release-Note: >Audit-Trail: >Unformatted: