From:             phpbugs at steve dot ipapp dot com
Operating system: Win 2000 SP4
PHP version:      5.2.5
PHP Bug Type:     Filesystem function related
Bug description:  is_readable() returns incorrect result

Description:
------------
NT ACL Permissions can be modified in Windows by right clicking on the
file, going to properties, and security. Clicking the Everyone user and
hitting Deny Read, will prevent ANYTHING from reading, even if they have 
READ permissions granted elsewhere. 

is_readable() doesn't seem to care and thinks that all these files are
readable, when in fact they aren't. is_writeable() probably has the same
problem. Previous Bugs Identified with this have been closed: 41519.



Reproduce code:
---------------
$some_file = 'C:\\path\to\file.txt';
if(is_readable($some_file))
{
   echo file_get_contents($some_file);
} else
{
   echo "This file isn't readable";
}




Expected result:
----------------
With NTFS ACL Permissions set to allow reading:

*Contents of File*

With NTFS ACL Permissions set to disallow reading:

"This file isn't readable";



Actual result:
--------------
With NTFS ACL Permissions set to allow reading:

*Contents of File*

With NTFS ACL Permissions set to disallow reading:

Warning: file_get_contents(C:\\path\to\file.txt)
[function.file-get-contents]: failed to open stream: Permission denied in
C:\\path\to\script.php on line 4

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

Reply via email to