From 629d9075cb439b3329a09a9f841bbf883453fd0b Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 5 Nov 2011 01:08:05 +0000 Subject: [PATCH] quick handlers and translate_name in lua can't be keyed off Directory/Filename/htaccess git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197853 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ modules/lua/mod_lua.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/CHANGES b/CHANGES index 0831bb9011..60a1201e42 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,11 @@ Changes with Apache 2.3.15 PR 51714. [Stefan Fritsch, Jim Jagielski, Ruediger Pluem, Eric Covener, ] + *) mod_lua: Prevent early Lua hooks (LuaHookTranslateName and + LuaHookQuickHandler) from being configured in , , + 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] diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index 816e674aba..a867fa4766 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -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); } -- 2.40.0