move_uploaded_file no longer working (safe mode related)
| Bug #39575 | move_uploaded_file no longer working (safe mode related) | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-11-21 23:08 UTC | Modified: | 2006-11-22 11:55 UTC | ||
| From: | ch at hoffie dot info | Assigned: | |||
| Status: | Closed | Package: | Safe Mode/open_basedir | ||
| PHP Version: | 5CVS-2006-11-21 (snap) | OS: | Linux 2.6 | ||
| Private report: | No | CVE-ID: | None | ||
[2006-11-21 23:08 UTC] ch at hoffie dot info
Description: ------------ While move_uploaded_file() correctly worked with PHP 5.2.0, it stopped working with recent snapshots of 5.2.1-dev (maybe earlier). Appearently PHP (main/safe_mode.c?) checks whether the target file exists -- and this obviously is never true for a file which is going to be moved there (but isn't there yet). ./configure --disable-all --disable-cli --enable-fastcgi Reproduce code: --------------- (with safe_mode enabled and a correct file upload POST request) <?php move_uploaded_file($_FILES['foo']['tmp_name'], "test.gif"); ?> Expected result: ---------------- The POSTed file should be moved to "test.gif" like in earlier PHP versions. Actual result: -------------- Warning: move_uploaded_file(): Unable to access /www/test.gif in /www/upload.php on line 2 No test.gif appears (although the permissions are correct; the uid of PHP is the same as the directory where test.gif should be put; nothing has been changed since the update from 5.2.0 to today's cvs snapshot)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-11-22 11:55 UTC] tony2001@php.net