]> granicus.if.org Git - apache/commitdiff
Throw a warning if AllowOverride is used inside of <Location> or <Files>.
authorAndré Malo <nd@apache.org>
Fri, 2 May 2003 21:50:55 +0000 (21:50 +0000)
committerAndré Malo <nd@apache.org>
Fri, 2 May 2003 21:50:55 +0000 (21:50 +0000)
Unfortunately there's no clean way to detect <DirectoryMatch>. It would
not be sufficient, because <Directory ~> should be checked then, too.
Hmm.

PR: 19512

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

server/core.c

index 328933ddab65f325af90b26eb1c93893d78d4a2b..9999e0932dc01d5f2b8306553d4971eb01032934 100644 (file)
@@ -1213,6 +1213,13 @@ static const char *set_override(cmd_parms *cmd, void *d_, const char *l)
         return err;
     }
 
+    /* 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,
+                     "Useless use of AllowOverride in line %d.",
+                     cmd->directive->line_num);
+    }
+
     d->override = OR_NONE;
     while (l[0]) {
         w = ap_getword_conf(cmd->pool, &l);