From:             bugzilla at ab dot thatcow dot com
Operating system: SunOS 5.9
PHP version:      4.3.1
PHP Bug Type:     Apache2 related
Bug description:  User not logged under Apache2

I send headers through PHP to force authentication. Under apache1.3, the
username would show up properly under my combined logs - under
apache2.0.44, I always see "-". The folks over at Apache (see their bug
#8500) suggest PHP needs to be setting user in the request structure.

I've add one line in php_apache_request_ctor() in sapi_apache2.c to set
this. This hack is fairly ignorant of the internals of both php and
apache, but here it is anyway. Do with as you wish. Forgive the formatting
here if it doesn't come out right.

<pre>
        if (!PG(safe_mode)) {
                auth = apr_table_get(f->r->headers_in, "Authorization");
                php_handle_auth_data(auth TSRMLS_CC);
+               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;
</pre>
-- 
Edit bug report at http://bugs.php.net/?id=22672&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22672&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22672&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22672&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22672&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22672&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22672&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22672&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22672&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22672&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22672&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22672&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22672&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22672&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22672&r=gnused

Reply via email to