Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 19261 invoked by uid 500); 12 Jun 2001 09:15:27 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 19236 invoked from network); 12 Jun 2001 09:15:24 -0000 Date: Tue, 12 Jun 2001 11:15:02 +0200 From: Martin Kraemer To: new-httpd@apache.org Subject: Line end comments in httpd-1.3.conf Message-ID: <20010612111502.C30289@deejai2.mch.fsc.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: FreeBSD 4.2-RELEASE FreeBSD 4.2-RELEASE X-Organization: Fujitsu Siemens Computers (Muenchen, Germany) X-Disclaimer: THE COMMENTS CONTAINED IN THIS MESSAGE REFLECT THE VIEWS OF THE WRITER AND ARE NOT NECESSARILY THE VIEWS OF FUJITSU-SIEMENS COMPUTERS X-No-Junk-Mail: I do not want to get *any* junk mail. X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The attached patch tries to address the problem that users sometimes attempt to use "line end comments" in the apache config files. Most directives will complain, but some might silently behave in an unexpected manner. To at least get informed about the problem, the patch prints a warning message during server start, saying: [Tue Jun 12 11:01:55 2001] [warn] Apache does not support line-end comments. Consider using quotes around argument: "#-1" The only "incompatible" place I know of is the "Group #-1" default we are using in httpd.conf-dist -- and an easy fix is to quote it. What do you think? This fix may improve stability and security by pointing to possible misconfigurations which before passed unnoticed. Martin -- | Fujitsu Siemens | 81730 Munich, Germany --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="apache-line-end-comment-warning.patch" Index: conf/httpd.conf-dist =================================================================== RCS file: /home/cvs/apache-1.3/conf/httpd.conf-dist,v retrieving revision 1.71 diff -u -r1.71 httpd.conf-dist --- conf/httpd.conf-dist 2001/05/13 17:59:49 1.71 +++ conf/httpd.conf-dist 2001/06/12 09:04:30 @@ -244,7 +244,7 @@ # don't use Group #-1 on these systems! # User nobody -Group #-1 +Group "#-1" # # ServerAdmin: Your address, where problems with the server should be Index: src/CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1689 diff -u -r1.1689 CHANGES --- src/CHANGES 2001/06/12 08:39:03 1.1689 +++ src/CHANGES 2001/06/12 09:05:20 @@ -1,5 +1,9 @@ Changes with Apache 1.3.21 + *) Print a warning when an attempt is made to use line-end comments. + Apparently they are not detected/handled gracefully by all directives. + [Martin Kraemer] + *) (Cygwin only) Fix problems with signals sent to child processes; Improve auto-configuration for Cygwin. [Stipe Tolj ] Index: src/main/util.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.197 diff -u -r1.197 util.c --- src/main/util.c 2001/03/30 17:37:54 1.197 +++ src/main/util.c 2001/06/12 09:05:28 @@ -811,6 +811,9 @@ ++strend; } else { + if (*str == '#') + ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, NULL, + "Apache does not support line-end comments. Consider using quotes around argument: \"%s\"", str); strend = str; while (*strend && !ap_isspace(*strend)) ++strend; --7AUc2qLy4jB3hD7Z--