]> granicus.if.org Git - apache/commitdiff
Provide a way for EXEC_ON_READ directives to see their context
authorEric Covener <covener@apache.org>
Fri, 30 Jan 2015 16:58:20 +0000 (16:58 +0000)
committerEric Covener <covener@apache.org>
Fri, 30 Jan 2015 16:58:20 +0000 (16:58 +0000)
(parent directive).

Usually, this context is not also EXEC_ON_READ so it's not fully processed, so
e.g cmd->path is not fluffed up yet because the closing tag
of the section is not read yet and ap_check_cmd_context()
doesn't work)

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

include/ap_mmn.h
include/http_config.h
server/config.c

index 0e991710c34e1766dd67999e9175bec70055319d..c6790aba7128c0047a106ec9c17407836790adff 100644 (file)
  *                         core_dir_config
  * 20140627.10 (2.5.0-dev) Add ap_proxy_de_socketfy to mod_proxy.h
  * 20150121.0 (2.5.0-dev)  Revert field addition from core_dir_config; r1653666
+ * 20150121.1 (2.5.0-dev)  Add cmd_parms_struct.parent to http_config.h
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20150121
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 0                 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1                 /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index da4490c0a4b350f293862b4b92e2a4f8a29a173b..0dfca50f4f8baa19ba2de05c5f856e28115de463 100644 (file)
@@ -325,7 +325,10 @@ struct cmd_parms_struct {
     struct ap_conf_vector_t *context;
     /** directive with syntax error */
     const ap_directive_t *err_directive;
-
+    /** If the current directive is EXEC_ON_READ, this is the 
+        enclosing directive  */
+    ap_directive_t *parent;
 };
 
 /**
index 50fa76d98c23f0a5e93dae5713fed9b3a9e9035e..d8afca7a348eb10afec0867faea9cdcbdeb98876 100644 (file)
@@ -841,7 +841,8 @@ AP_DECLARE(module *) ap_find_linked_module(const char *name)
 #define AP_MAX_ARGC 64
 
 static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
-                              void *mconfig, const char *args)
+                              void *mconfig, const char *args, 
+                              ap_directive_t *parent)
 {
     int override_list_ok = 0;
     char *w, *w2, *w3;
@@ -870,6 +871,7 @@ static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
 
     parms->info = cmd->cmd_data;
     parms->cmd = cmd;
+    parms->parent = parent;
 
     switch (cmd->args_how) {
     case RAW_ARGS:
@@ -1306,7 +1308,7 @@ static const char *ap_walk_config_sub(const ap_directive_t *current,
             continue;
         }
 
-        retval = invoke_cmd(cmd, parms, dir_config, current->args);
+        retval = invoke_cmd(cmd, parms, dir_config, current->args, NULL);
 
         if (retval != NULL && strcmp(retval, DECLINE_CMD) != 0) {
             /* If the directive in error has already been set, don't
@@ -1670,7 +1672,7 @@ static const char *execute_now(char *cmd_line, const char *args,
         const char *retval;
         cmd = ml->cmd;
 
-        retval = invoke_cmd(cmd, parms, sub_tree, args);
+        retval = invoke_cmd(cmd, parms, sub_tree, args, parent);
 
         if (retval != NULL) {
             return retval;