|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-24 02:49 UTC] public at cs dot uwa dot edu dot au
This is possibly related to Bug #17858. We've got Apache2 on Redhat 7.3, with safemode in php enabled. We have safe_mode_gid set to on as well. The safe_mode include directory is set as follows: safe_mode_include_dir = "/home/staff/ryan/WWW" I've then got the test script: <?php if ($dir = opendir("/home/staff/ryan/WWW")) {while (($file = readdir($dir)) !== false) { echo "$file\n"; } closedir($dir); } else { echo "FAILED"; } ?> That script has the following ownership permissions: -rw-r--r-- 1 web nobody 229 Oct 24 15:31 test2.php And /home/staff/ryan/WWW is: drwxr-xr-x 5 ryan staff 4096 Oct 21 17:30 WWW Calling the script displays "FAILED" on the browser and causes the two following errors in the error log: PHP Warning: opendir() [<a href='http://www.php.net/function.opendir'>function.opendir</a>]: SAFE MODE Restriction in effect. The script whose uid/gid is 89/99 is not allowed to access /home/staff/ryan/WWW/ owned by uid/gid 270/110 in /home/www/DOCS/phptest/test2.php on line 3 PHP Warning: opendir(/home/staff/ryan/WWW/) [<a href='http://www.php.net/function.opendir'>function.opendir</a>]: failed to open dir: Inappropriate ioctl for device in /home/www/DOCS/phptest/test2.php on line 3 Changing the ownership permissions to the same user and/or group causes the script to execute fine, displaying the contents with no problems or errors. It would appear that the safe_mode_include_dir value is not being used, but I'm also open to the suggesion that I've stuffed up somewhere else. For the record, I originally started having problems with 4.2.2 (user and group returned as -1) this was fixed upgrading to 4.3.0-pre1, but then the include_dir still had problems. I've tested it with today's snapshot (php4-200210232100) and still have the same problem. My config options looks like : ./configure --with-mysql=/usr/local/mysql --with-openssl --with-xml --enable-track-vars --enable-force-cgi-redirect --enable-versioning --with-apxs2=/usr/local/httpd/bin/apxs --with-zlib --enable-ftp --enable-sockets --with-gettext --with-imap=/usr/local/imap --with-imap-ssl Ummm, help? Cheers, Ryan. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 21:00:01 2025 UTC |
Just for the record, I wrote a patch for this to allow for paths to be excluded from the safemode checks basically the same as the include value does. Posted that the the developers list asking if anyone was interested, enver got a reply, so I thought I'd add it in here for completeness sake. If anyone has any suggestions with what I can do with the patch, let me know :}