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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jonas at brachium-system dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-03 21:45 UTC] jonas at brachium-system dot net
error hat user
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 15:01:35 2025 UTC