Bug #17108 Updated: Safe Mode open_basedir doesn't check file UID but does dir UID
| From: | php-bugs at icirc dot net | Date: | Thu, 13 Jun 2002 15:44:56 +0000 |
| Subject: | Bug #17108 Updated: Safe Mode open_basedir doesn't check file UID but does dir UID | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10356@lists.php.net to get a copy of this message | ||
ID: 17108
Updated by: php-bugs@icirc.net
Reported By: php-bugs@icirc.net
Status: Feedback
Bug Type: PHP options/info functions
Operating System: FreeBSD 4.5-STABLE
PHP Version: 4.2.0
New Comment:
The problem is when using both open_basedir AND php Safe Mode. Some
people do actually want to use both!
Previous Comments:
------------------------------------------------------------------------
[2002-05-20 14:41:20] mfischer@php.net
As far as I can see there's no uid checking done when only using
open_basedir. You're most likely using safe mode enabled and therefore
activated uid checking.
Or maybe I missed something?
------------------------------------------------------------------------
[2002-05-08 23:21:34] php-bugs@icirc.net
Hello,
I'm not sure if this is a bug, or whether it is meant to do this,
however since it makes no sense, I figure it must be a bug.
Basically, when you use open_basedir, you should be able to open any
files in basedir path, regardless of UID.
So if apache is expecting the user Alasdair, and it tries to access a
file owned by a different user, it only allows this if this file
resides in the basedir path.
If you create a directory with the correct user, and stick a file in it
with the wrong user, this still works as long as the directory is in
the basedir path.
However, if you change the ownership of this directory to an incorrect
user, you can no longer access any of the files in that directory!
This seems quite mad, as the whole point of open_basedir is so you
don't have to worry about ownerships so long as everything you access
resides in the basedir.
The offending C file is safe_mode.c, which i've attempted to modify
unsuccessfully, mostly due to the fact I have no idea whats going on in
it. I could get it to always return 1, though ;)
The reason I require this is that I need to allow users to access files
and directories created by apache, for some scripts that do this.
Apache of course sets created files/dirs to its own UID. This is fine
for files, but any directories created PHP won't access, due to this
feature/bug.
I have searched the web, and asked in #PHP on openprojects, but
couldn't turn up any information.
Any help is greatly appriciated, the only other solution would be to
turn Safe Mode off.
Configure options:
./configure --with-apxs=/usr/local/psa/apache/bin/apxs
--prefix=/usr/local/psa/apache --with-system-regex
--with-config-file-path=/usr/local/psa/apache/conf --disable-debug
--disable-pear --enable-sockets --enable-track-vars
--with-gd=/usr/local/src/gd-1.8.4 --with-mysql=/usr/local/psa/mysql
--with-iodbc=/usr/local/src/imap-2001a/libiodbc-3.0.5
--with-imap=/usr/local/src/imap-2001a
(Although i can replicate this problem even with the simplest setup, i
don't think the local options cause this problem)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17108&edit=1