]> granicus.if.org Git - apache/commitdiff
In AllowOverrideList, do not allow 'None' together with other directives.
authorStefan Fritsch <sf@apache.org>
Mon, 19 Mar 2012 20:57:19 +0000 (20:57 +0000)
committerStefan Fritsch <sf@apache.org>
Mon, 19 Mar 2012 20:57:19 +0000 (20:57 +0000)
While there, improve log messages and save some memory by allocating correct
size for table.

PR 52823

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1302653 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/core.c

diff --git a/CHANGES b/CHANGES
index 9c60ba3542fe491db13e169f3c4d35639a9a3de1..829a2be4aee9cd379ef0c884d8d89df030da54c9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core: In AllowOverrideList, do not allow 'None' together with other
+     directives. PR 52823. [Stefan Fritsch]
+
   *) mod_proxy: Correctly set up reverse proxy worker. PR 52935.
      [Petter Berntsen <petterb gmail.com>]
 
index d28b14b2ce77324ed512f94ea6d192ea034fb7ed..374a1f64ebd9c860df216b51824d5f085264f85f 100644 (file)
@@ -1661,16 +1661,20 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
     /* Throw a warning if we're in <Location> or <Files> */
     if (ap_check_cmd_context(cmd, NOT_IN_LOCATION | NOT_IN_FILES)) {
         ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00115)
-                     "Useless use of AllowOverrideList in line %d of %s.",
-                     cmd->directive->line_num, cmd->directive->filename);
+                     "Useless use of AllowOverrideList at %s:%d",
+                     cmd->directive->filename, cmd->directive->line_num);
     }
     if ((err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS)) != NULL)
         return err;
 
-    d->override_list = apr_table_make(cmd->pool, 1);
+    d->override_list = apr_table_make(cmd->pool, argc);
 
     for (i=0;i<argc;i++){
         if (!strcasecmp(argv[i], "None")) {
+            if (argc != 1) {
+                return "'None' not allowed with other directives in "
+                       "AllowOverrideList";
+            }
             return NULL;
         }
         else {
@@ -1680,9 +1684,11 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
             if (result)
                 apr_table_set(d->override_list, argv[i], "1");
             else
-                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00116)
-                             "Discarding unrecognized directive `%s' in AllowOverrideList.",
-                             argv[i]);
+                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
+                             APLOGNO(00116) "Discarding unrecognized "
+                             "directive `%s' in AllowOverrideList at %s:%d",
+                             argv[i], cmd->directive->filename,
+                             cmd->directive->line_num);
         }
     }