]> granicus.if.org Git - apache/commitdiff
mod_proxy: Fix ProxyPassInterpolateEnv directive.
authorStefan Fritsch <sf@apache.org>
Thu, 18 Nov 2010 20:15:24 +0000 (20:15 +0000)
committerStefan Fritsch <sf@apache.org>
Thu, 18 Nov 2010 20:15:24 +0000 (20:15 +0000)
PR: 50292

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

CHANGES
include/ap_mmn.h
include/http_config.h
modules/proxy/mod_proxy.c
server/config.c

diff --git a/CHANGES b/CHANGES
index f83db1f2e1a549ba03775d5b8eb80086a5a3559f..898ed2e9a114a77d1e7c5143841af5fcc57c48e0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@ Changes with Apache 2.3.9
      Fix a denial of service attack against mod_reqtimeout.
      [Stefan Fritsch]
 
+  *) mod_proxy: Fix ProxyPassInterpolateEnv directive. PR 50292.
+     [Stefan Fritsch]
+
   *) suEXEC: Add Suexec directive to disable suEXEC without renaming the
      binary (Suexec Off), or force startup failure if suEXEC is required
      but not supported (Suexec On).  Change SuexecUserGroup to fail 
index 792c8cd837b88a3bc8a0ef09d160899765626626..3f7d3d566c85263ae858b7729592b0991699b8a7 100644 (file)
  * 20101106.1 (2.3.9-dev)  Add ap_pool_cleanup_set_null() generic cleanup
  * 20101106.2 (2.3.9-dev)  Add suexec_disabled_reason field to ap_unixd_config
  * 20101113.0 (2.3.9-dev)  Add source address to mod_proxy.h
+ * 20101113.1 (2.3.9-dev)  Add ap_set_flag_slot_char()
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20101113
 #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 47a90cc546ccb1c5090c978c396da7fa6f750ed3..66f73bac7c87f9807a67f8b8588dafc7c7f96670 100644 (file)
@@ -640,7 +640,7 @@ AP_DECLARE_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd,
                                                          void *struct_ptr, 
                                                          const char *arg);
 /**
- * Generic command handling function for flags
+ * Generic command handling function for flags stored in an int
  * @param cmd The command parameters for this directive
  * @param struct_ptr pointer into a given type
  * @param arg The argument to the directive (either 1 or 0)
@@ -649,6 +649,16 @@ AP_DECLARE_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd,
 AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, 
                                                  void *struct_ptr, 
                                                  int arg);
+/**
+ * Generic command handling function for flags stored in a char
+ * @param cmd The command parameters for this directive
+ * @param struct_ptr pointer into a given type
+ * @param arg The argument to the directive (either 1 or 0)
+ * @return An error string or NULL on success
+ */
+AP_DECLARE_NONSTD(const char *) ap_set_flag_slot_char(cmd_parms *cmd, 
+                                                      void *struct_ptr, 
+                                                      int arg);
 /**
  * Generic command handling function for files
  * @param cmd The command parameters for this directive
index 23eab0e65ec8309fc22c09393236034fdeb2b3ad..dc66bb7dd3985dc8ab4222ceb08a6b81fc6c1c89 100644 (file)
@@ -2170,7 +2170,7 @@ static const command_rec proxy_cmds[] =
      "a scheme, partial URL or '*' and a proxy server"),
     AP_INIT_TAKE2("ProxyRemoteMatch", add_proxy_regex, NULL, RSRC_CONF,
      "a regex pattern and a proxy server"),
-    AP_INIT_FLAG("ProxyPassInterpolateEnv", ap_set_flag_slot,
+    AP_INIT_FLAG("ProxyPassInterpolateEnv", ap_set_flag_slot_char,
         (void*)APR_OFFSETOF(proxy_dir_conf, interpolate_env),
         RSRC_CONF|ACCESS_CONF, "Interpolate Env Vars in reverse Proxy") ,
     AP_INIT_RAW_ARGS("ProxyPass", add_pass_noregex, NULL, RSRC_CONF|ACCESS_CONF,
index dbbbaca3798300d05e34e73c3044d45638949533..465ee59e1025f8b728d037e6e9723f991937c353 100644 (file)
@@ -1396,6 +1396,18 @@ AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd,
     return NULL;
 }
 
+AP_DECLARE_NONSTD(const char *) ap_set_flag_slot_char(cmd_parms *cmd,
+                                                      void *struct_ptr_v, int arg)
+{
+    int offset = (int)(long)cmd->info;
+    char *struct_ptr = (char *)struct_ptr_v;
+
+    *(struct_ptr + offset) = arg ? 1 : 0;
+
+    return NULL;
+}
+
+
 AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_ptr,
                                                  const char *arg)
 {