#39198 [NEW]: is_dir seem to have permission problems
From: php dot spam at frogblender dot net
Operating system: Windows 2003
PHP version: 5.1.6
PHP Bug Type: Directory function related
Bug description: is_dir seem to have permission problems
Description:
------------
If you have a directory where Everyone has "Full Control" rights you would
expect is_dir to return true but it doesn't.
This bug has existed since 5.0.0 and I've had this problem on at least
three servers during the past year.
I'm lying about my PHP version (it's really 5.1.4) but I've checked the
change log.
realpath() seem to exhibit the proper behavior.
Reproduce code:
---------------
<?php
print("<pre>");
error_reporting(E_ALL);
#clearstatcache();
$paths = array(
"C:\\",
"C:\\Windows",
"C:\\Windows\\Temp",
"C:\\Windows\\Temp\\RP_Compile",
"C:\\Windows\\Temp\\DoesNotExist",
"C:\\Windows\\Temp\\RP_Compile\\Subdir",
);
print("\nis_dir()\n");
foreach($paths as $path)
print(is_dir($path) . " \t$path\n");
print("\nrealpath()\n");
foreach($paths as $path)
print(!(realpath($path) === FALSE) . " \t$path\n");
print("\nstat()\n");
foreach($paths as $path)
print(!(stat($path) === FALSE) . " \t$path\n");
print("</pre>");
?>
Expected result:
----------------
is_dir()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
realpath()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
Actual result:
--------------
Notice the different result for "C:\Windows\Temp\RP_Compile"
is_dir()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
realpath()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
--
Edit bug report at http://bugs.php.net/?id=39198&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39198&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39198&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39198&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39198&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39198&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39198&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39198&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39198&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39198&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39198&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39198&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39198&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39198&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39198&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39198&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39198&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39198&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39198&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39198&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39198&r=mysqlcfg
Thread (16 messages)
- php dot spam at frogblender dot net
- tony2001@php.net#39198 [Opn->Fbk]: is_dir seem to have permission problems
- php dot spam at frogblender dot net#39198 [Fbk->Opn]: is_dir seem to have permission problems
- tony2001@php.net#39198 [Opn->Bgs]: is_dir seem to have permission problems
- php dot spam at frogblender dot net#39198 [Bgs->Opn]: is_dir seem to have permission problems
- tony2001@php.net#39198 [Opn->Fbk]: is_dir seem to have permission problems
- php dot spam at frogblender dot net#39198 [NoF->Opn]: is_dir seem to have permission problems
- tony2001@php.net#39198 [Opn->Fbk]: is_dir seem to have permission problems
- php dot spam at frogblender dot net#39198 [Fbk->Opn]: is_dir seem to have permission problems
- tony2001@php.net#39198 [Opn->Fbk]: is_dir seem to have permission problems
- scvxzvxc at gmail dot om#39198 [Com]: is_dir seem to have permission problems
- legolas558 at users dot sourceforge dot net#39198 [Com]: is_dir seem to have permission problems
- sweston at lyon dot edu#39198 [Com]: is_dir seem to have permission problems
- phpbugs at mainskill dot com#39198 [Com]: is_dir seem to have permission problems
- phpbugs at mainskill dot com#39198 [Com]: is_dir seem to have permission problems
- h_guillaume at hotmail dot comBug #39198 [Com]: is_dir seem to have permission problems