#39555 [Opn->Bgs]: ftp_rawlist not work with open_basedir
| From: | iliaa@php.net | Date: | Sun, 19 Nov 2006 17:01:48 +0000 |
| Subject: | #39555 [Opn->Bgs]: ftp_rawlist not work with open_basedir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105187@lists.php.net to get a copy of this message | ||
ID: 39555
Updated by: iliaa@php.net
Reported By: freidman at mail dot ru
-Status: Open
+Status: Bogus
Bug Type: FTP related
Operating System: Gentoo Linux
PHP Version: 5.2.0
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
In order to use tmp directory with open_basedir the directory
must be part of the open_basedir directive.
Previous Comments:
------------------------------------------------------------------------
[2006-11-19 10:18:27] freidman at mail dot ru
Description:
------------
This is related to bug #32708
There must be a way to set tmp-file creation of this functions, but
setting TMPDIR environment variable doesn't work. I don't want to
include /tmp dir in open_basedir directories.
Reproduce code:
---------------
<?php
putenv('TMPDIR=/hosting/clients/xxx.com/httpd/tmp');
echo getenv('TMPDIR');
// set up basic connection
$conn_id = ftp_connect("xxx.com");
// login with username and password
$login_result = ftp_login($conn_id, "xxx", "xxx");
// get the file list for /
$buff = ftp_rawlist($conn_id, '/');
// close the connection
ftp_close($conn_id);
// output the buffer
var_dump($buff);
?>
Expected result:
----------------
listing of files
Actual result:
--------------
/hosting/clients/xxx.com/httpd/tmp
Warning: ftp_rawlist() [function.ftp-rawlist]: open_basedir restriction
in effect. File(/tmp) is not within the allowed path(s):
(/hosting/clients/xxx.com/httpd:/usr/lib/php:/usr/local/lib/php) in
/hosting/clients/xxx.com/httpd/htdocs/a.php on line 15
Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create
temporary file. Check permissions in temporary files directory. in
/hosting/clients/xxx.com/httpd/htdocs/a.php on line 15
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39555&edit=1