ID: 44638
Updated by: [EMAIL PROTECTED]
Reported By: graham at wyenet dot net
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Solaris 10
PHP Version: 5.2.5
New Comment:
According to unlink(2) manpage on Solaris:
If the path argument is a directory and the filesystem sup-
ports unlink() and unlinkat() on directories, the directory
is unlinked from its parent with no cleanup being performed.
In UFS, the disconnected directory will be found the next
time the filesystem is checked with fsck(1M).
The issue does only exist with a Solaris box using UFS and when run as
"root" user. That's Solaris' behaviour where PHP has no influence.
Marking as bogus therefore.
Previous Comments:
------------------------------------------------------------------------
[2008-04-07 11:05:34] graham at wyenet dot net
It would appear its only really a problem when running php as the
"Root" user. For lower privileged users Solaris10 appears to be giving
the following result.
Warning: unlink(test): Not owner in Command line code on line 1.
The test suite failed because I compiled PHP using "Root". When I tried
again using my normal user access it worked fine.
It does seem that on solaris 10, running the test suite as the root
user may cause a failer during copy_variation4.phpt.
------------------------------------------------------------------------
[2008-04-04 18:11:31] [EMAIL PROTECTED]
$ php -r 'unlink("ttt");'
Warning: unlink(ttt): Is a directory in Command line code on line 1
Perhaps Solaris unlink() actually allows unlinking directories?
PHP just wraps around the libc unlink() so..
------------------------------------------------------------------------
[2008-04-04 13:02:16] graham at wyenet dot net
Description:
------------
unlink() function will erase full (or empty) directories, where
permissions are ok.
This actually breaks test suite, test copy_variation4.phpt which
creates null files. The unlink actually removes the
ext/standard/tests/file directory and then of course the test suits
crashes out.
Reproduce code:
---------------
<?php
unlink("test");
?>
Expected result:
----------------
PHP 5.2.3 on Solaris gives the following error.
[function.unlink]: Not owner in test.php
Although it would make more sence to be
[function.unlink]: Is directory in test.php
Actual result:
--------------
directory test is erased without warning, even if there are files
present in the directory. fsck will recover the files. It wont break
ownership permissions, and it wont erase directories containing file
which where ownership permissions come into place.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44638&edit=1