From: Stanislav Malyshev Date: Wed, 17 Dec 2008 11:34:50 +0000 (+0000) Subject: MFH fix #46005 X-Git-Tag: php-5.3.0beta1~419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40cd1d49b3ab8daa0d839a0aae2664f22b14e77c;p=php MFH fix #46005 --- diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index ecd1eb624d..4e3efffdc4 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -427,6 +427,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) { auth = apr_table_get(f->r->headers_in, "Authorization"); php_handle_auth_data(auth TSRMLS_CC); + if (SG(request_info).auth_user == NULL && f->r->user) { + SG(request_info).auth_user = estrdup(f->r->user); + } + ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); } else { SG(request_info).auth_user = NULL; SG(request_info).auth_password = NULL; diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index cf2e1427be..a34a9399fa 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -472,6 +472,9 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) { auth = apr_table_get(r->headers_in, "Authorization"); php_handle_auth_data(auth TSRMLS_CC); + if (SG(request_info).auth_user == NULL && r->user) { + SG(request_info).auth_user = estrdup(r->user); + } ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); } else { SG(request_info).auth_user = NULL;