summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2008-12-18 14:28:35 +0000
committerStanislav Malyshev <stas@php.net>2008-12-18 14:28:35 +0000
commitd3dce9e02ef148b11f90e27983feb3a9d10059d0 (patch)
treec6429c1150ddd719a21a03429a8cec199b3bc1e9
parenteaa3298b4adeb9af5756d0c81e1476097db8a656 (diff)
downloadphp-git-d3dce9e02ef148b11f90e27983feb3a9d10059d0.tar.gz
MFH fix #46005
-rw-r--r--sapi/apache2filter/sapi_apache2.c4
-rw-r--r--sapi/apache2handler/sapi_apache2.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 0b163c8273..715ec4a221 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -411,6 +411,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 524a10f52a..2b58775b6c 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -456,6 +456,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;