|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-27 15:59 UTC] rebe at unit01 dot net
Description:
------------
Latest go-pear:
$Id: go-pear,v 1.81 2006/03/11 14:15:20 pajoye Exp $
fails on php5 with open_basedir restriction.
Function tmp_dir() about line 1156 has check code:
$_temp = my_env('TMPDIR');
if (!$_temp) {
if (is_writable('/tmp')) {
$_temp = '/tmp';
}
}
which fails cause is_writable('/tmp') return true (!!) even if php cannot write anything there because of restrictions, so then in line 423:
$ptmp = tempnam($foo, 'gope');
$ptmp becomes ampty - script is downloading packages into current dir which makes then conflicts and errors.
I suggest to change this:
if (!$_temp) {
if (is_writable('/tmp')) {
$_temp = '/tmp';
}
}
to something like that:
if (!$_temp) {
$test = '/tmp/'.uniqid();
if (@mkdir($test)) {
@rmdir($test);
$_temp = '/tmp';
}
}
which forces to create something to check if its possible.
------------------------
Second small bug is that after i fixed that code above and installation finished with success i got link:
"Start Web Frontend of the PEAR Installer >>"
which points to pear/pear/index.php dir instead of pear/index.php dir (where "pear" was my dir i choosed to put go-pear.php there and run with defaults).
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
The original subject is misleading, changing to what is the real problem. this is not a problem in PEAR per se, but the documentation for is_writable() should state that it ignores open_basedir settings. As the original report states, open_basedir did not include /tmp and so is_writable('/tmp') falsely returns "true" when open_basedir in fact prevents writing to /tmp