Bug #14076: fopen() and touch() fail to create file under safe mode
| From: | a dot genkin at utoronto dot ca | Date: | Thu, 15 Nov 2001 23:53:16 +0000 |
| Subject: | Bug #14076: fopen() and touch() fail to create file under safe mode | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-70609@lists.php.net to get a copy of this message | ||
From: a.genkin@utoronto.ca
Operating system: Linux
PHP version: 4.0.6
PHP Bug Type: *Directory/Filesystem functions
Bug description: fopen() and touch() fail to create file under safe mode
Under safe mode, fopen("filename", "w") fails to create a file if it
doesn't exist, complaining about open_basedir restriction. However, the
filename refers to the file in the directory configured in the
open_basedir. Besides, if the same file is created manually, fopen() can
open it for writing without any problems. The directory is writeable to
the web server.
$dir = '/var/www/tmp/submit';
// Fails if the file doesn't exist.
// Succeeds if the file does exist
fopen( "$dir/file.txt", "w" ); // Fails if the file doesn't exist.
mkdir( "$dir/foo", 0700 ); // SUCCEEDS!!! Notice the same path.
--
Edit bug report at: http://bugs.php.net/?id=14076&edit=1