#46255 [Opn->Bgs]: unexpected success when function should fail
ID: 46255
Updated by: derick@php.net
Reported By: fritz at hoseanetworks dot com
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Fedora 8
PHP Version: 5.2.6
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
For unlink() to work the *directory's* permissions are checked. This is
proper Unix behavior.
Previous Comments:
------------------------------------------------------------------------
[2008-10-08 15:19:36] fritz at hoseanetworks dot com
Description:
------------
I get a successful file delete using function unlink when I believe it
should fail.
Apache is running as user "apache".
The files are owned by user "root".
The files all have read only permissions "444".
Here is output from ps:
apache 1334 0.1 1.5 39272 16328 ? S 07:25 0:04
/usr/sbin/httpd
Reproduce code:
---------------
$file = "/var/www/foo/bar.html"
$result = unlink($filename);
Expected result:
----------------
Unlink should fail due to file being read-only and owned by a user
other than apache.
Actual result:
--------------
Unlink deletes the file successfully.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46255&edit=1
Thread (2 messages)