ID:               14076
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Feedback
 Bug Type:         *Directory/Filesystem functions
 Operating System: Linux
 PHP Version:      4.0.6
 New Comment:

I could not reproduce this issue.
Here's my layout for the virtual server (from httpd.conf):
DocumentRoot /path_to_site/html
Options FollowSymLinks

php_admin_value open_basedir path_to_sitephp_admin_value doc_root
path_to_site
php_admin_value safe_mode_include_dir path_to_site
safe_mode=on in php.ini
PHP version: both 4.0.6 and 4.2.0RC2
create PHP-script at "path_to_site/html/scriptname"
create directory "path_to_site/html/test" writable by the apache user,
then make symlink "path_to_site/html/test2" to that directory

<?
$fh=fopen("$DOCUMENT_ROOT/test2/1.txt", "w");
fwrite($fh, "test\n");
echo $fh,"\n";
fclose($fh);
mkdir("$DOCUMENT_ROOT/test2/xxx/",770);
?>


lynx http://sitename/scriptname gives "Resource id#1"

No errors found in php_error_log,
looked at path_to_site/html/test2/ and saw there both 1.txt contained
"test" and xxx subdirectory.


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

[2002-04-03 15:38:25] [EMAIL PROTECTED]

Unfortunately this bug is *not* fixed in 4.2.0rc1.

I can reproduce both problems (fopen fails if file does not exist /
safe_mode_includedir does not work). If I use "real" path statements
(e.g. /mnt/hda7/web/file.php instead of /var/web/file.php) everything
works fine (please see my previous posts to #14076)

Let me know if I can help with more tests or debug output. It would be
very nice to have this problem fixed in the next release.

Hajo

------------------------------------------------------------------------

[2002-04-03 11:59:12] [EMAIL PROTECTED]

This should be fixed. Please see www.php.net/~derick for the latest RC
for 4.2.0m, and report back.

Derick

------------------------------------------------------------------------

[2002-04-03 11:56:31] [EMAIL PROTECTED]

This bug still exists in PHP 4.1.2.

A similiar problem also affects safe_mode_include_dir (path-statements
containing symlinks do not work: "The script whose uid is 1234 is not
allowed to access /my/safe_mode_include_path/with/symlink/mail.php
owned by uid 0").

Could someone *please* fix this ?

Hajo

------------------------------------------------------------------------

[2002-01-17 14:59:12] [EMAIL PROTECTED]

I've verified that this problem still exists in PHP 4.1.1.

Hajo Noerenberg

------------------------------------------------------------------------

[2002-01-16 13:42:52] [EMAIL PROTECTED]

As a workaround you can use relative paths in all of
your fopen()-calls: fopen("./test.html") always works
(I think php prepends the *expanded path* then -- see
the last paragraph in my previous comment).

Hajo

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/14076

-- 
Edit this bug report at http://bugs.php.net/?id=14076&edit=1

Reply via email to