Commit f38b572e authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1729930, r1729931 from trunk:

hostname: Test and log useragent_host per-request across various modules,
including the scoreboard, expression and rewrite engines, setenvif,
authz_host, access_compat, custom logging, ssl and REMOTE_HOST variables.
PR55348  [William Rowe]

This is the complete change set which applies cleanly to 2.4.x as well,
the server/scoreboard.c will follow, which does not apply due to drift.



A rather ugly patch since the code was refactored recently to exclude
the simple patch for 2.4.x, illustrated below.

Completes the changeset r1729930 and resolves all 2.4.19-dev corrections,
but other 2.5.0-dev specific changes may still be needed on trunk.

--- server/scoreboard.c	(revision 1729907)
+++ server/scoreboard.c	(working copy)
@@ -491,9 +491,8 @@
             ws->conn_bytes = 0;
         }
         if (r) {
-            const char *client = ap_get_remote_host(c, r->per_dir_config,
-                                 REMOTE_NOLOOKUP, NULL);
-            if (!client || !strcmp(client, c->client_ip)) {
+            const char *client;
+            if (!(client = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) {
                 apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
             }
             else {


Submitted by: wrowe
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1733282 13f79535-47bb-0310-9956-ffa450edef68
parent adda6f6f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@

Changes with Apache 2.4.19

  *) hostname: Test and log useragent_host per-request across various modules,
     including the scoreboard, expression and rewrite engines, setenvif,
     authz_host, access_compat, custom logging, ssl and REMOTE_HOST variables.
     PR55348  [William Rowe]
 
  *) core: Track the useragent_host per-request when mod_remoteip or similar
     modules track a per-request useragent_ip.  Modules should be updated
     to inquire for ap_get_useragent_host() in place of ap_get_remote_host().
+0 −11
Original line number Diff line number Diff line
@@ -112,17 +112,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) hostname: Test and log useragent_host per-request across various modules,
     including the scoreboard, expression and rewrite engines, setenvif,
     authz_host, access_compat, custom logging, ssl and REMOTE_HOST variables.
     PR55348  [William Rowe]
     Trunk version of patch:
         http://svn.apache.org/r1729930
         http://svn.apache.org/r1729931
     Trunk patch r1729930 applies, modulo CHANGES
     Backport patch to r1729931 is noted in the commit log message
     Requires r1729929 to be applied.
     +1: wrowe, ylavic, icing


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
+2 −4
Original line number Diff line number Diff line
@@ -276,9 +276,7 @@ static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
            if (!gothost) {
                int remotehost_is_ip;

                remotehost = ap_get_remote_host(r->connection,
                                                r->per_dir_config,
                                                REMOTE_DOUBLE_REV,
                remotehost = ap_get_useragent_host(r, REMOTE_DOUBLE_REV,
                                                   &remotehost_is_ip);

                if ((remotehost == NULL) || remotehost_is_ip) {
+1 −4
Original line number Diff line number Diff line
@@ -168,10 +168,7 @@ static authz_status host_check_authorization(request_rec *r,
    const char *remotehost = NULL;
    int remotehost_is_ip;

    remotehost = ap_get_remote_host(r->connection,
                                    r->per_dir_config,
                                    REMOTE_DOUBLE_REV,
                                    &remotehost_is_ip);
    remotehost = ap_get_useragent_host(r, REMOTE_DOUBLE_REV, &remotehost_is_ip);

    if ((remotehost == NULL) || remotehost_is_ip) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01753)
+1 −2
Original line number Diff line number Diff line
@@ -1020,8 +1020,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
            else if (strcEQ(var, "REMOTE_ADDR"))
                result = r->useragent_ip;
            else if (strcEQ(var, "REMOTE_HOST"))
                result = ap_get_remote_host(r->connection, r->per_dir_config,
                                            REMOTE_NAME, NULL);
                result = ap_get_useragent_host(r, REMOTE_NAME, NULL);
            else if (strcEQ(var, "REMOTE_IDENT"))
                result = ap_get_remote_logname(r);
            else if (strcEQ(var, "REMOTE_USER"))
Loading