ID:               44562
 Updated by:       [EMAIL PROTECTED]
 Reported By:      nlgordon at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Safe Mode/open_basedir
 Operating System: RHEL 4
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




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

[2008-03-28 22:14:57] nlgordon at gmail dot com

Description:
------------
Given the following scenario:

open_basedir enabled to /var/www/foo
upload_tmp_dir set to /var/www/foo/tmpdir
No free file space to handle the upload in the temp dir specified.

Causes PHP to throw an error that doesn't make a lot of sense to my end
users:

Warning: Unknown: open_basedir restriction in effect. File(/tmp) is not
within the allowed path(s): (/var/www/foo/tmpdir) in Unknown on line 0

This makes things look like a permissions issue.  I have tracked down
the source of the error to main/php_open_temporary_file.c:254  There is
a comment there that if the first attempt fails, it will use the system
temp dir.  While that might be fine on systems without open_basedir
enabled, it can cause some confusing error messages otherwise.  The
error message of "File upload error - unable to create a temporary file"
is perfect for this error, and it does show up.  It just isn't the first
or most noticeable error.

I notice that in the php_get_temporary_directory function (which is
what determines /tmp as the temp dir) that there are options for
changing this default.  I plan on setting TMPDIR per vhost as a work
around, but this seems unnecessary as I already set upload_tmp_dir.

I'm not sure what the perfect answer to this is, but I'm not sure I
agree with magically changing something I specifically set without
telling me.  Some of the extremists might even label this a security
issue.



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


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

Reply via email to