|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-12 13:06 UTC] justin dot white at mci dot com
[2003-11-12 13:08 UTC] iliaa@php.net
[2003-11-12 13:23 UTC] justin dot white at mci dot com
[2003-11-12 13:24 UTC] justin dot white at mci dot com
[2003-11-12 23:56 UTC] justin dot white at mci dot com
[2003-11-13 04:14 UTC] justin dot white at mci dot com
[2003-11-13 08:19 UTC] wez@php.net
[2003-11-13 11:17 UTC] justin dot white at mci dot com
[2016-12-30 18:53 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: Filesystem function related
[2017-10-24 01:49 UTC] kalle@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: kalle
[2017-10-24 01:49 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
Description: ------------ On Linux, PHP 4.3.3 correctly returns file permissions from the filesystem. With Windows 2000 and IIS, PHP in CGI or ISAPI mode does not. The reproduce code assumes that another file (TEST.PHP) already exists in the filesystem. Any other file or directory could be used (although the permissions are returned differently for directories). TEST.PHP can have any permissions, including explicitly DENY "Full Access" for EVERYONE group. Reproduce code: --------------- <?php clearstatcache(); $test = fileperms('c:/inetpub/wwwroot/test.php'); echo '<H1>PERMS = '; $read = ($test & 0x0004) ? 'r' : '-'; $write = ($test & 0x0002) ? 'w' : '-'; $execute = ($test & 0x0001) ? 'x' : '-'; echo $read.$write.$execute.'</H1>'; ?> Expected result: ---------------- For files, returned results should be "<H1>PERMS = r--</H1>' if permissions were set to READ. Returned results should be "<H1>PERMS = rw-</H1>" if permissions were set to READ/WRITE or READ/WRITE/MODIFY. Returned results should be "<H1>PERMS = rwx</H1>" if permissions were set to READ/EXECUTE/WRITE or READ/EXECUTE/WRITE/MODIFY or FULL CONTROL. For directories, returned result should be similar (although permissions on directory are more well-defined). Actual result: -------------- For files, returned results will always be "<H1>PERMS = rw-</H1>'; For directories, returned result will always be "<H1>PERMS = rwx</H1>'; Even attempting this operation on "C:/pagefile.sys" returned "<H1>PERMS = rw-". Curiously, when marking the file as "read-only" in the file properties (not security tab), the returned results are "<H1>PERMS = r--</H1>" for files and "<H1>PERMS = r-x</H1>" for directories.