]> granicus.if.org Git - apache/commitdiff
quick handlers and translate_name in lua can't be keyed off
authorEric Covener <covener@apache.org>
Sat, 5 Nov 2011 01:08:05 +0000 (01:08 +0000)
committerEric Covener <covener@apache.org>
Sat, 5 Nov 2011 01:08:05 +0000 (01:08 +0000)
Directory/Filename/htaccess

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

CHANGES
modules/lua/mod_lua.c

diff --git a/CHANGES b/CHANGES
index 0831bb901160d865535d11bc28d74d1b0cde29a3..60a1201e4255542a201cfc9c8b02b80cf9714046 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,11 @@ Changes with Apache 2.3.15
      PR 51714. [Stefan Fritsch, Jim Jagielski, Ruediger Pluem, Eric Covener,
      <lowprio20 gmail.com>]
 
+  *) mod_lua: Prevent early Lua hooks (LuaHookTranslateName and 
+     LuaHookQuickHandler) from being configured in <Directory>, <Files>, 
+     and htaccess where the configuration would have been ignored.
+     [Eric Covener]
+
   *) mod_lua: Resolve "attempt to index local 'r' (a userdata value)" errors
      in LuaMapHandler scripts [Eric Covener]
 
index 816e674abac2093925b7e9d6d3cee8d7d5305bcb..a867fa47666f5597bd3c0df79cb8c2e95b90c964 100644 (file)
@@ -619,6 +619,11 @@ static const char *register_translate_name_hook(cmd_parms *cmd, void *_cfg,
                                                 const char *file,
                                                 const char *function)
 {
+    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES|
+                                           NOT_IN_HTACCESS);
+    if (err) {
+        return err;
+    }
     return register_named_file_function_hook("translate_name", cmd, _cfg,
                                              file, function);
 }
@@ -626,6 +631,11 @@ static const char *register_translate_name_hook(cmd_parms *cmd, void *_cfg,
 static const char *register_translate_name_block(cmd_parms *cmd, void *_cfg,
                                                  const char *line)
 {
+    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES|
+                                                NOT_IN_HTACCESS);
+    if (err) {
+        return err;
+    }
     return register_named_block_function_hook("translate_name", cmd, _cfg,
                                               line);
 }
@@ -724,12 +734,23 @@ static const char *register_insert_filter_hook(cmd_parms *cmd, void *_cfg,
 static const char *register_quick_hook(cmd_parms *cmd, void *_cfg,
                                        const char *file, const char *function)
 {
+    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES|
+                                                NOT_IN_HTACCESS);
+    if (err) {
+        return err;
+    }
     return register_named_file_function_hook("quick", cmd, _cfg, file,
                                              function);
 }
 static const char *register_quick_block(cmd_parms *cmd, void *_cfg,
                                         const char *line)
 {
+    const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES|
+                                                NOT_IN_HTACCESS);
+    if (err) {
+        return err;
+    }
     return register_named_block_function_hook("quick", cmd, _cfg,
                                               line);
 }