php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49762 unlink can't handle posix acls
Submitted: 2009-10-03 21:42 UTC Modified: 2009-10-03 21:45 UTC
From: jonas at brachium-system dot net Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.2.11 OS: Debian Lenny
Private report: No CVE-ID: None
 [2009-10-03 21:42 UTC] jonas at brachium-system dot net
Description:
------------
the php function unlink can't handle posix acls. The function is_writeable **can** handle posix acls. See #34957


my acl on file 'foo':
----------------------
# file: foo
# owner: jonas.genannt
# group: users
user::rw-
group::r-x                      #effective:r--
group:www-data:rw-
mask::rw-
other::---

The php script runs as user www-data and group www-data. 

The function unlink fails on posix acls but is_writeable seems to be handling posix acls.



Reproduce code:
---------------
<?php
if (is_writeable('foo')) {
        echo "fooo is Writeable<br/>";
        if (unlink('foo')) {
                echo "Removed!";
        }
        else {
                echo "NOT REMOVED!<br/>";
        }
}
?>

Expected result:
----------------
fooo is Writeable
Removed

Actual result:
--------------
fooo is Writeable
Warning: unlink(foo) [function.unlink]: Permission denied in test.php on line 4
NOT REMOVED!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-03 21:45 UTC] jonas at brachium-system dot net
error hat user
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 22:01:29 2024 UTC