Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #43491 : Under certain conditions, file_exists() never returns
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 15th August 19:31
php-bugs
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns



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 With Quote


  sponsored links


2 15th August 22:06
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns



ID: 43491
Updated by: jani@php.net
Reported By: amccardie at cox dot net
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2.5
New Comment:

Please try using this CVS snapshot:

http://snaps.php.net/php5.2-latest.tar.gz

For Windows (zip):

http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

http://snaps.php.net/win32/php5.2-win32-installer-latest.msi


Previous Comments:
------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote
3 15th August 22:07
php-bugs
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns


ID: 43491
User updated by: amccardie at cox dot net
Reported By: amccardie at cox dot net
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2.5
New Comment:

As suggested, I tried the latest snapshot. I see the same results as
described above. BTW, this happens with the CLI as well as mod_php.


Previous Comments:
------------------------------------------------------------------------

[2007-12-04 12:29:24] jani@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5.2-latest.tar.gz

For Windows (zip):

http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote
4 16th August 00:35
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns


ID: 43491
Updated by: jani@php.net
Reported By: amccardie at cox dot net
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2.5
New Comment:

So it just hangs there or what? (script never ends)

Previous Comments:
------------------------------------------------------------------------

[2007-12-04 16:00:55] amccardie at cox dot net

As suggested, I tried the latest snapshot. I see the same results as
described above. BTW, this happens with the CLI as well as mod_php.

------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote
5 16th August 00:51
php-bugs
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns


ID: 43491
User updated by: amccardie at cox dot net
Reported By: amccardie at cox dot net
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2-CVS-2007-12-05
New Comment:

Exactly. The script hangs at the call to file_exists().

Also, using the CLI, the php.exe process goes to 99% CPU time. When it
happens with mod_php, the httpd.exe process hogs the CPU.


Previous Comments:
------------------------------------------------------------------------

[2007-12-05 11:03:43] jani@php.net

So it just hangs there or what? (script never ends)


------------------------------------------------------------------------

[2007-12-04 16:00:55] amccardie at cox dot net

As suggested, I tried the latest snapshot. I see the same results as
described above. BTW, this happens with the CLI as well as mod_php.

------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote
6 24th August 20:26
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns


ID: 43491
Updated by: tony2001@php.net
Reported By: amccardie at cox dot net
-Status: Open
+Status: Assigned
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2-CVS-2007-12-05
-Assigned To:
+Assigned To: dmitry


Previous Comments:
------------------------------------------------------------------------

[2007-12-05 15:25:13] amccardie at cox dot net

Exactly. The script hangs at the call to file_exists().

Also, using the CLI, the php.exe process goes to 99% CPU time. When it
happens with mod_php, the httpd.exe process hogs the CPU.

------------------------------------------------------------------------

[2007-12-05 11:03:43] jani@php.net

So it just hangs there or what? (script never ends)


------------------------------------------------------------------------

[2007-12-04 16:00:55] amccardie at cox dot net

As suggested, I tried the latest snapshot. I see the same results as
described above. BTW, this happens with the CLI as well as mod_php.

------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote
7 24th August 23:19
External User
 
Posts: 1
Default #43491 : Under certain conditions, file_exists() never returns


ID: 43491
Updated by: dmitry@php.net
Reported By: amccardie at cox dot net
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: Windows 2003 SP2
PHP Version: 5.2-CVS-2007-12-05
Assigned To: dmitry
New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

Thank you for the report, and for helping us make PHP better.


Previous Comments:
------------------------------------------------------------------------

[2007-12-05 15:25:13] amccardie at cox dot net

Exactly. The script hangs at the call to file_exists().

Also, using the CLI, the php.exe process goes to 99% CPU time. When it
happens with mod_php, the httpd.exe process hogs the CPU.

------------------------------------------------------------------------

[2007-12-05 11:03:43] jani@php.net

So it just hangs there or what? (script never ends)


------------------------------------------------------------------------

[2007-12-04 16:00:55] amccardie at cox dot net

As suggested, I tried the latest snapshot. I see the same results as
described above. BTW, this happens with the CLI as well as mod_php.

------------------------------------------------------------------------

[2007-12-04 00:19:33] amccardie at cox dot net

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 this bug report at http://bugs.php.net/?id=43491&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666