ID: 37395
User updated by: n dot escuder at intra-links dot com
Reported By: n dot escuder at intra-links dot com
-Status: Bogus
+Status: Open
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 5.1.4
New Comment:
I jave made a little mistake in my expample here is the good test file
:
<?
ini_set( "include_path", "/tmp/link" );
mkdir( "/tmp/php", 0777, true );
touch( "/tmp/php/one.php" );
symlink( "/tmp/php", "/tmp/link" );
require_once "one.php";
mkdir( "/tmp/essai" );
chroot( "/tmp/essai" );
mkdir( "/tmp/link", 0777, true );
$fd = fopen( "/tmp/link/one.php", "wb" );
?>
as you can see we just created /tmp/essai
and /tmp/link in chrooted of /tmp/essai
and after trye to create /tmp/link/one.php fail !
It's due to the link in the include_path
Previous Comments:
------------------------------------------------------------------------
[2006-05-15 21:49:43] [EMAIL PROTECTED]
Remove all those @ and you'll see the very expected error messages.
------------------------------------------------------------------------
[2006-05-10 11:41:23] n dot escuder at intra-links dot com
Description:
------------
fopen report no such file or directory when open in w mode.
It's seem to be related with include path with symlink as you can see
in sample
if the include path is /tmp/php all work.
but if the include path is /tmp/link ( sym link ) the script fail.
Reproduce code:
---------------
ini_set('include_path', "/tmp/link");
@mkdir("/tmp/php", 0777, true);
touch("/tmp/php/one.php");
@symlink( "/tmp/php", "/tmp/link" );
require_once "one.php";
@mkdir("/tmp/essai");
chroot("/tmp/essai" );
@mkdir("/tmp/link/interfaces", 0777, true);
$fd = fopen("/tmp/link/one.php", "wb");
Expected result:
----------------
No error and an file pointer in $fd
Actual result:
--------------
Warning: fopen(/tmp/link/one.php): failed to open stream: No such file
or directory in /tmp/essai.php on line 16
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37395&edit=1