ID:               44638
 Updated by:       [EMAIL PROTECTED]
 Reported By:      graham at wyenet dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         *Directory/Filesystem functions
 Operating System: Solaris 10
 PHP Version:      5.2.5
-Assigned To:      
+Assigned To:      fb-req-jani
 New Comment:

$ 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..


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to