|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-06-11 22:11 UTC] uwe dot pries at digartis dot de
Description: ------------ check: http://digger.homelinux.net:8080/php_tests/ http://digger.homelinux.net:8080/php_tests/is_readable_basic.out PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 07:00:01 2025 UTC |
Hi Uwe Could I get you to try a couple of simple tests for me? Could you run the following PHP: <?php $name_prefix = dirname(__FILE__); $filename = "$name_prefix/fred.tmp"; mkdir("$name_prefix/mary/", 0777, true); // create a temp file $file_handle = fopen($filename, "w"); fclose($file_handle); $link_arr= array( "$name_prefix/../$name_prefix/no_file.tmp" ); var_dump( symlink($filename, $link_arr[0]) ); var_dump( readlink($link_arr[0]) ); var_dump( realpath($link_arr[0]) ); unlink("$name_prefix/fred.tmp"); rmdir("$name_prefix/mary/"); ?> When you run it please would you do it by giving the full path name of the PHP executable? Probably something like this: /home/uwe/php52/sapi/cli/php simpletest.php Would you run a second test where you just type: php simpletest.php The reason for this is that I can reproduce your failure with an older version of PHP (in fact the one that comes on Ubuntu as default), so I suspect that you might be picking this up accidentally. Please would you attach the output from both tests to this bugzilla?Hi Uwe I now understand this as far as it's possible for me, the next step is to get someone more expert to look at it - so I'm summarising and assigning back to Johannes. Summary ======= There are two parts to this defect - first the problem with tests being run as root. I have fixed those test cases. The second part is with the failing readlink_realpath_variation.phpt test. This test is failing on Uwe's sytem because he has used the configure option --enable-maintainer-zts. There are two problems with readlink_realpath_variation.phpt. First the test case has been coded incorrectly, it should *pass* with --enable-maintainer-zts and should *fail* without it. Secondly, there is a bug in PHP which needs someone fairly expert to look at it. I will change the test case so that it fails properly instead of testing for, and passing, incorrect behaviour. Here is a simple reproduce test case for the failure: --TEST-- Dump failure result of trying to create non-existant link followed by realpath() on non-existant link --FILE-- <?php $name_prefix = dirname(__FILE__); $filename = "$name_prefix/fred.tmp"; mkdir("$name_prefix/mary/", 0777, true); // create a temp file $file_handle = fopen($filename, "w"); fclose($file_handle); $no_such_link = "$name_prefix/../$name_prefix/no_file.tmp"; //******************************************// var_dump( symlink($filename, $no_such_link) ); var_dump( realpath($no_such_link )); //******************************************// unlink("$name_prefix/fred.tmp"); rmdir("$name_prefix/mary/"); ?> --EXPECTF-- Warning: symlink(): No such file or directory in %s on line %d bool(false) bool(false) The two important lines are marked by ***. Both of these work correctly on their own - but not together.