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
-- 
<[EMAIL PROTECTED]>    |       Fujitsu Siemens
       <[EMAIL PROTECTED]>              |   81730  Munich,  Germany
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 <[EMAIL PROTECTED]>]
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;

Reply via email to