]> granicus.if.org Git - apache-authnz-external/commitdiff
Replace c->remote_ip with r->useragent_ip for compatibility with Apache 2.4.1
authorjan@unixpapa.com <jan@unixpapa.com@8c465660-3f02-11de-a81c-fde7d73ceb89>
Wed, 11 Dec 2013 19:45:24 +0000 (19:45 +0000)
committerjan@unixpapa.com <jan@unixpapa.com@8c465660-3f02-11de-a81c-fde7d73ceb89>
Wed, 11 Dec 2013 19:45:24 +0000 (19:45 +0000)
and later.  Backout addition of FORWARDS environment variable, the need for
which is obviated by this.

mod_authnz_external/AUTHENTICATORS
mod_authnz_external/CHANGES
mod_authnz_external/mod_authnz_external.c

index aaf176a3ae39bbd6e52d763908ce74b92ffc3d4d..98cde11ce110deb9292e6219c078aff7ac5d39a5 100644 (file)
@@ -252,14 +252,6 @@ OTHER ENVIRONMENT VARIABLES
     HOST      the host name corresponding to IP, if Apache has
               "HostnameLookups On".
 
-    FORWARDS  If a load-balancer or proxy is being used, then the "IP" variable
-             is just going to be the ip-address of the server that forwarded
-             the client's request to the current server. In that case, the
-             "FORWARDS" environment variable gives a comma-separated list of
-             ip-addresses, the first of which will be the original client's ip,
-              while the rest are all the other proxies the request was forwarded
-              through before reaching the server named by the the "IP" variable.
-
     PATH      the httpd's path environment variable.
 
     COOKIE    all cookie values passed in by the client.
index 01f5f72c70b5c4d251f801db33e941dd5fa11593..c7552fc0e2d4c0f5a9739d8109942be3c3bdb436 100644 (file)
@@ -1,11 +1,12 @@
 v3.3.2   (Jan Wolter - Dec 11, 2013)
 ----------------------------------------------
+ * Replaced reference to remote_ip field of the connection record with
+   useragent_ip, due to the elimination of remote_ip in Apache 2.4.1. Thanks
+   to davidsansome and cjwatson for pointing out the need for this.
  * Fixed a bug with setting of GROUP environment variable. Thanks to
    ddarbyson for reporting this, and Guoan Hu for posting the fix.
  * Added test/test.pipe.php, a PHP version of test/test.pipe contributed
    by Claus Andersen.
- * Added the FORWARDS environment variable for use with load balancing servers.
-   This patch contributed by Rogier Slag.
 
 v3.3.1   (Jan Wolter - Oct 12, 2011)
 ----------------------------------------------
index 14eec7d071e222dac44160b3d80cd825879b518d..10bc007f6ef0cbdd1e8ca4b37d84c3d6636beec6 100644 (file)
@@ -96,7 +96,6 @@
 #define ENV_HOST       "HOST"          /* Remote Host */
 #define ENV_HTTP_HOST  "HTTP_HOST"     /* Local Host */
 #define ENV_CONTEXT    "CONTEXT"       /* Arbitrary Data from Config */
-#define ENV_FORWARDS   "FORWARDS"
 /* Undefine this if you do not want cookies passed to the script */
 #define ENV_COOKIE     "COOKIE"
 
@@ -401,7 +400,7 @@ static int exec_external(const char *extpath, const char *extmethod,
     apr_procattr_t *procattr;
     apr_proc_t proc;
     apr_status_t rc= APR_SUCCESS;
-    char *child_env[13];
+    char *child_env[12];
     char *child_arg[MAX_ARG+2];
     const char *t;
     int i, status= -4;
@@ -424,7 +423,7 @@ static int exec_external(const char *extpath, const char *extmethod,
 
     if (!isdaemon)
     {
-       const char *cookie, *host, *remote_host, *forwards;
+       const char *cookie, *host, *remote_host;
        authnz_external_dir_config_rec *dir= (authnz_external_dir_config_rec *)
            ap_get_module_config(r->per_dir_config, &authnz_external_module);
        i= 0;
@@ -444,8 +443,8 @@ static int exec_external(const char *extpath, const char *extmethod,
        if (remote_host != NULL)
            child_env[i++]= apr_pstrcat(p, ENV_HOST"=", remote_host,NULL);
 
-       if (c->remote_ip)
-           child_env[i++]= apr_pstrcat(p, ENV_IP"=", c->remote_ip, NULL);
+       if (r->useragent_ip)
+           child_env[i++]= apr_pstrcat(p, ENV_IP"=", r->useragent_ip, NULL);
 
        if (r->uri)
            child_env[i++]= apr_pstrcat(p, ENV_URI"=", r->uri, NULL);
@@ -457,9 +456,6 @@ static int exec_external(const char *extpath, const char *extmethod,
            child_env[i++]= apr_pstrcat(r->pool, ENV_CONTEXT"=",
                dir->context, NULL);
 
-       if ((forwards= apr_table_get(r->headers_in, "X-Forwarded-For")) != NULL)
-           child_env[i++]= apr_pstrcat(p, ENV_FORWARDS"=", forwards, NULL);
-
 #ifdef ENV_COOKIE
        if ((cookie= apr_table_get(r->headers_in, "Cookie")) != NULL)
            child_env[i++]= apr_pstrcat(p, ENV_COOKIE"=", cookie, NULL);