#48111 [Opn]: unlink won't delete symlinks without a target if open_basedir is used
| From: | simon at stienen dot name | Date: | Wed, 29 Apr 2009 17:45:18 +0000 |
| Subject: | #48111 [Opn]: unlink won't delete symlinks without a target if open_basedir is used | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136518@lists.php.net to get a copy of this message | ||
ID: 48111
User updated by: simon at stienen dot name
-Summary: unlink won't delete symlinks without a target
Reported By: simon at stienen dot name
Status: Open
Bug Type: Filesystem function related
Operating System: FreeBSD 7.1-RELEASE/amd64
PHP Version: 5.2.9
New Comment:
forgot open_basedir in the title
Previous Comments:
------------------------------------------------------------------------
[2009-04-29 17:42:48] simon at stienen dot name
Description:
------------
unlink()ing a symlink with its target missing fails with an
open_basedir error.
This might be related to
http://bugs.php.net/bug.php?id=20235 (actual
deletion changed, but
sanitization still uses target?) and/or
http://bugs.php.net/bug.php?id=29145 (missing
target (empty string?) is
considered to be outside of open_basedir?)
Reproduce code:
---------------
<?php
echo "creating link\n";
symlink('nonexisting_target', 'link');
echo "unlinking link\n";
unlink('link');
echo "creating target\n";
file_put_contents('nonexisting_target', 'foo');
echo "unlinking link (again)\n";
unlink('link');
echo "unlinking target\n";
unlink('nonexisting_target');
Expected result:
----------------
Run with php -d open_basedir=
creating link
unlinking link
creating target
unlinking link (again)
Warning: unlink(link): No such file or directory in /tmp/- on line 13
unlinking target
Actual result:
--------------
Run with php -d open_basedir=/
creating link
unlinking link
Warning: unlink(): open_basedir restriction in effect. File(link) is
not within the allowed path(s): (/) in /tmp/- on line 7
creating target
unlinking link (again)
unlinking target
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48111&edit=1