From 7ec3747dcb891a21712b67d9be79eee8fd47923b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Wed, 23 Jul 2003 21:53:42 +0000 Subject: [PATCH] Remember an authenticated user during internal redirects if the redirection target is not access protected and pass it to scripts using the REDIRECT_REMOTE_USER environment variable. PR: 10678, 11602. Reviewed by: Jeff Trawick, Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@100751 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ STATUS | 8 +------- server/util_script.c | 11 +++++++++++ support/suexec.c | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 1a1d8d46606..7ecf00682e3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.48 + *) Remember an authenticated user during internal redirects if the + redirection target is not access protected and pass it + to scripts using the REDIRECT_REMOTE_USER environment variable. + PR 10678, 11602. [André Malo] + *) mod_include: Fix a trio of bugs that would cause various unusual sequences of parsed bytes to omit portions of the output stream. PR 21095. [Ron Park , André Malo, Cliff Woolley] diff --git a/STATUS b/STATUS index 601db4cc941..296b8474947 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/07/23 20:28:26 $] +Last modified at [$Date: 2003/07/23 21:53:41 $] Release: @@ -276,12 +276,6 @@ PATCHES TO PORT FROM 2.1 modules/ssl/ssl_engine_vars.c: r1.24 +1: trawick, nd - * pass REDIRECT_REMOTE_USER to the script if REMOTE_USER doesn't - exist and the original request is protected. - server/util_script.c: r1.82 - support/suexec.c: r1.27 - +1: nd, trawick, jerenkrantz - * use the appropriate folder icon, even if there's a directoryindex listed file in the particular folder. PR 9587 modules/generators/mod_autoindex.c r1.120 diff --git a/server/util_script.c b/server/util_script.c index b33873eb7ef..dd7d9ce4168 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -286,6 +286,17 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) if (r->user) { apr_table_addn(e, "REMOTE_USER", r->user); } + else if (r->prev) { + request_rec *back = r->prev; + + while (back) { + if (back->user) { + apr_table_addn(e, "REDIRECT_REMOTE_USER", back->user); + break; + } + back = back->prev; + } + } if (r->ap_auth_type) { apr_table_addn(e, "AUTH_TYPE", r->ap_auth_type); } diff --git a/support/suexec.c b/support/suexec.c index 1976cdfc62f..53e0da7d7de 100644 --- a/support/suexec.c +++ b/support/suexec.c @@ -159,6 +159,7 @@ char *safe_env_lst[] = "REMOTE_PORT=", "REMOTE_USER=", "REDIRECT_QUERY_STRING=", + "REDIRECT_REMOTE_USER=", "REDIRECT_STATUS=", "REDIRECT_URL=", "REQUEST_METHOD=", -- 2.47.2