From: kulpp at wsg dot net Operating system: Linux PHP version: 4.3.4 PHP Bug Type: Filesystem function related Bug description: tempnam broken in SAFE MODE
Description: ------------ Back in 4.0.3, tempnam() was changed to actually create the temp file to avoid a race condition. It would seem that the current implemntation is inconsistent with SAFE MODE restrictions which then prevent access to the filename returned by tempnam(). Reproduce code: --------------- <% $filename = tempnam('', 'test_'); fopen($filename, 'r'); %> Expected result: ---------------- no errors or warnings Actual result: -------------- Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 579 is not allowed to access /tmp/test_zSTbRQ owned by uid 18 in /usr/local/www/docs/test/tempnam_broken.php on line 5 Warning: fopen(/tmp/test_zSTbRQ): failed to open stream: Permission denied in /usr/local/www/docs/test/tempnam_broken.php on line 5 -- Edit bug report at http://bugs.php.net/?id=27133&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27133&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27133&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27133&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27133&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27133&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27133&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27133&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27133&r=support Expected behavior: http://bugs.php.net/fix.php?id=27133&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27133&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27133&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27133&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27133&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27133&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27133&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27133&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27133&r=float