From:             amccardie at cox dot net
Operating system: Windows 2003 SP2
PHP version:      5.2.5
PHP Bug Type:     Filesystem function related
Bug description:  Under certain conditions, file_exists() never returns

Description:
------------
When open_basedir is set in php.ini, file_exists() will never return if
called with an argument containing a ":/" or ":\\" without a corresponding
drive letter.

Example:

file_exists("C:/foo.txt") => works
file_exists("C:\\foo.txt") => works

file_exists(":/foo.txt") never returns.
file_exists(":\\foo.txt") never returns.

Tested under Windows 2003 Server with SP2 and Windows XP Pro, both using
Apache 2.2.6/mod_php. 

Reproduce code:
---------------
copy php.ini-dist to php.ini
set open_basedir = C:/

<?php
//Should print "no"
print file_exists("C:/foo.txt")?"yes\n":"no\n";

//Should also print "no" but never returns,
//causing high CPU, if open_basedir is set
print file_exists(":/foo.txt")?"yes\n":"no\n";
exit;
?>

Expected result:
----------------
no
no

Actual result:
--------------
no
file_exists() call never returns

-- 
Edit bug report at http://bugs.php.net/?id=43491&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43491&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43491&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43491&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43491&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43491&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43491&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43491&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43491&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43491&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43491&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43491&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43491&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43491&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43491&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43491&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43491&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43491&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43491&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43491&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43491&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43491&r=mysqlcfg

Reply via email to