ID: 27133 Updated by: [EMAIL PROTECTED] Reported By: kulpp at wsg dot net Status: Bogus Bug Type: Filesystem function related Operating System: Linux PHP Version: 4.3.4 New Comment:
see: http://www.php.net/tempnam And notice the first parameter you can give it.. This is intentional. Previous Comments: ------------------------------------------------------------------------ [2004-02-03 10:12:30] [EMAIL PROTECTED] 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 When creating a temporary filename, you should use the 1st parameter to the function to specify a directory which you will be able to access. ------------------------------------------------------------------------ [2004-02-03 10:01:49] kulpp at wsg dot net 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 this bug report at http://bugs.php.net/?id=27133&edit=1