ID: 44638
User updated by: graham at wyenet dot net
Reported By: graham at wyenet dot net
-Status: Feedback
+Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Solaris 10
PHP Version: 5.2.5
Assigned To: fb-req-jani
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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