fopen don't work in some conditions
| Bug #37395 | fopen don't work in some conditions | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2006-05-10 11:41 UTC | Modified: | 2007-02-21 13:19 UTC |
|
||||||||||
| From: | n dot escuder at intra-links dot com | Assigned: | ||||||||||||
| Status: | Closed | Package: | Filesystem function related | |||||||||||
| PHP Version: | 5.2.0 | OS: | Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2006-05-10 11:41 UTC] 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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-05-15 21:49 UTC] tony2001@php.net
[2006-05-16 11:38 UTC] n dot escuder at intra-links dot com
[2006-05-16 13:07 UTC] tony2001@php.net
[2007-01-10 16:27 UTC] n dot escuder at intra-links dot com
[2007-02-21 13:19 UTC] n dot escuder at intra-links dot com