Req #26224 [Opn->Csd]: fileperms() inaccurately reports permissions

From: Date: Tue, 24 Oct 2017 01:49:38 +0000
Subject: Req #26224 [Opn->Csd]: fileperms() inaccurately reports permissions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211873@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=26224&edit=1 ID: 26224 Updated by: kalle@php.net Reported by: justin dot white at mci dot com Summary: fileperms() inaccurately reports permissions -Status: Open +Status: Closed Type: Feature/Change Request Package: Filesystem function related Operating System: Windows 2000 PHP Version: 4.3.3 -Assigned To: +Assigned To: kalle Block user comment: N Private report: N New Comment: I'm pretty sure this was fixed in the movement of providing a more solid Windows implementation for PHP that began in PHP 5.3, closing this report. Previous Comments: ------------------------------------------------------------------------ [2003-11-13 11:17:50] justin dot white at mci dot com I think if you had read my post that you would have known that I understood what attributes DOS offered. However, we're not talking about DOS here. In Windows NT/2000/XP/2003, NTFS ACLs are completely ignored by PHP in determining the file properties. If libc does not provide a list of NTFS permissions, the list should be available through other means. That's a pretty important function for filesystem access. The only way to fix the problem is a change specifically for Win32 to use the GetSecurityInfo() call from Win32 API. Here's some information on it from MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/getsecurityinfo.asp Apparently, the Tcl-win folks have had the same problem in porting Tcl to Windows. Here's a discussion of their problems and possible solutions: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=749876&group_id=10894 ------------------------------------------------------------------------ [2003-11-13 08:19:32] wez@php.net You do realize that DOS only has a notion of a limited set of file attributes? (essentially, there is just a read-only flag). The "security tab" under windows displays the contents of the NTFS ACL; PHP just uses the functions provided by the MS libc, which seem to ignore the ACL. ------------------------------------------------------------------------ [2003-11-13 04:14:27] justin dot white at mci dot com Oops. It looks like my statement about 4.3.2 was incorrect. The system I was looking at had some files labeled as "Read Only" in the file properties, but the file security had no bearing on the result... Back to the drawing board. ------------------------------------------------------------------------ [2003-11-12 23:56:37] justin dot white at mci dot com I have been able to confirm that version 4.3.2 does not have this bug. I will be testing 4.3.4 shortly to see whether the bug has been resolved... ------------------------------------------------------------------------ [2003-11-12 13:24:05] justin dot white at mci dot com I also have a RH8 server with PHP 4.3.3 available and the sample code works flawlessly. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=26224 -- Edit this bug report at https://bugs.php.net/bug.php?id=26224&edit=1

« previous php.bugs (#211873) next »