From:             [EMAIL PROTECTED]
Operating system: Solaris 5.8
PHP version:      4.0.6
PHP Bug Type:     Apache related
Bug description:  Safe mode (apache with mod_perl) uses incorrect uid

In PHP 4.0.6 (and 4.0.5) using apache with mod_perl and php4 compiled in
(statically), safe mode denies access to all files, believing that it is
running as UID 1 [basically this is like bug # 7744 ].

Recompiling apache and leaving out mod perl, allows the php pages to be
accessed with safe mode. Not running with safe mode while mod_perl is
compiled in, allows the php pages to be accessed. Only when mod_perl is
compiled in and safe mode is running does every single page (even a simple
phpinfo() or something with a single print() ) returns the following (this
was a request for "/test.php"):

[08-Aug-2001 13:00:11] PHP Warning:  SAFE MODE Restriction in effect.  The
script whose uid is 1 is not allowed to access /var/htdocs/test.php owned
by uid 0 in Unknown on line 0
[08-Aug-2001 13:00:11] PHP Warning:  Failed opening '/var/htdocs/test.php'
for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

Granted root owns it in the above example, but it does not matter if the
uid is that of me, the webserver, or someone else. Note that the original
request is for test.php. As no includes, system calls, etc... are done in
test.php, it should work regardless of who actually owns that file.

It seems to be looking for an owner uid of 1. I tried putting some printf's
in the code and it seems that the stat struct that is returned from
sapi_get_stat() - I think the one directly from the apache "request" object
- is messed up. It always has a uid of 1, a size of 0, and a inode of 0.

Mod perl is before php in the activate-modules directives given when
building apache, and it shows up above php when running "httpd -l". If I
didn't know any better, I'd think this was a perl bug, but it is php that
isn't working.

-- 
Edit bug report at: http://bugs.php.net/?id=12683&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to