Date: 07/11/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #3977 Updated: date() function no more sensitive to TZ environment variable"
- Previous message: Joey Smith: "[PHP-DEV] Sybase DB-Lib"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: alban.hertroys <email protected>
Operating system: Any
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: tempnam() is not safe
$filename = tempnam("/tmp", "blah");
<do all kinds of stuff that takes more than 0 seconds>
$fd = fopen($filename, "w+");
This could result in another proces on the system creating a temp-file with the same name in the meantime, which then will be overwritten by PHP.
See man mkstemp on any UNIX for more details and the solution to the same problem (returning a file descriptor of a newly opened temp-file instead of a filename).
It could be that PHP found a way to magically circumvent the problem, but that is not documented anywhere I looked.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #3977 Updated: date() function no more sensitive to TZ environment variable"
- Previous message: Joey Smith: "[PHP-DEV] Sybase DB-Lib"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

