From nobody@FreeBSD.org  Tue Jun 24 14:17:23 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE79A1065677
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <bambyster@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: comments at the end of the line of the syslog.conf
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124938
>Category:       bin
>Synopsis:       [patch] syslog.conf(5): comments at the end of the line of the syslog.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sobomax
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 24 14:20:02 UTC 2008
>Closed-Date:    Mon Jan 12 18:28:08 UTC 2009
>Last-Modified:  Mon Jan 12 18:28:08 UTC 2009
>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:

From: Andriy Pylypenko <bambyster@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/124938: [patch] syslog.conf(5): comments at the end of the
 line of the syslog.conf
Date: Thu, 26 Jun 2008 10:28:08 +0300

 This is a multi-part message in MIME format.
 --------------030301030303080304080207
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I'm sending an improved version of the patch. It now supports '#' in 
 filenames when specified as '\#'. The code borrowed from newsyslog.
 
 -- 
   Kind regards,
   Andriy Pylypenko
   Development Lead
   Sippy Software, Inc.
   Internet Telephony (VoIP) Experts
   T/F: +1-646-651-1110
   Web: http://www.sippysoft.com
 
 
 --------------030301030303080304080207
 Content-Type: text/plain;
  name="syslogd.txt"
 Content-Transfer-Encoding: base64
 Content-Disposition: inline;
  filename="syslogd.txt"
 
 LS0tIHN5c2xvZ2QuYy5vcmlnCTIwMDgtMDYtMjQgMTY6MjQ6MTAuMDAwMDAwMDAwICswMzAw
 CisrKyBzeXNsb2dkLmMJMjAwOC0wNi0yNiAxMDoxNDoyNi4wMDAwMDAwMDAgKzAzMDAKQEAg
 LTE2MzUsNiArMTYzNSwxNyBAQAogCQkJcHJvZ1tpXSA9IDA7CiAJCQljb250aW51ZTsKIAkJ
 fQorCQlmb3IgKHAgPSBjbGluZSArIDE7ICpwICE9ICdcMCc7IHArKykgeworCQkJaWYgKCpw
 ICE9ICcjJykKKwkJCQljb250aW51ZTsKKwkJCWlmICgqKHAgLSAxKSA9PSAnXFwnKSB7CisJ
 CQkJc3RyY3B5KHAgLSAxLCBwKTsKKwkJCQlwLS07CisJCQkJY29udGludWU7CisJCQl9CisJ
 CQkqcCA9ICdcMCc7CisJCQlicmVhazsKKwkJfQogCQlmb3IgKGkgPSBzdHJsZW4oY2xpbmUp
 IC0gMTsgaSA+PSAwICYmIGlzc3BhY2UoY2xpbmVbaV0pOyBpLS0pCiAJCQljbGluZVtpXSA9
 ICdcMCc7CiAJCWYgPSAoc3RydWN0IGZpbGVkICopY2FsbG9jKDEsIHNpemVvZigqZikpOwo=
 --------------030301030303080304080207--
Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Aug 4 13:16:23 UTC 2008 
Responsible-Changed-Why:  
Grab 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124938 
State-Changed-From-To: open->patched 
State-Changed-By: edwin 
State-Changed-When: Wed Aug 6 01:32:43 UTC 2008 
State-Changed-Why:  
Sobomax has fixed this in r180380 

http://svn.freebsd.org/viewvc/base?view=revision&revision=180380 



Responsible-Changed-From-To: edwin->sobomax 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Aug 6 01:32:43 UTC 2008 
Responsible-Changed-Why:  
Sobomax has fixed this in HEAD, but not yet MFCd 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124938 
State-Changed-From-To: patched->closed 
State-Changed-By: sobomax 
State-Changed-When: Mon Jan 12 18:27:31 UTC 2009 
State-Changed-Why:  
The change checked in and MFCed into RELENG_6 and RELENG_7. Thank you for 
submission! 

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