php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9249 tempnam() may return bad filename
Submitted: 2001-02-13 19:33 UTC Modified: 2001-04-27 21:46 UTC
From: seeliger dot curt at epa dot gov Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: linux
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
19 - 7 = ?
Subscribe to this entry?

 
 [2001-02-13 19:33 UTC] seeliger dot curt at epa dot gov
$dir='/foo/bar/';
$prefix='prefix';
$tname=tempnam($dir, $prefix);
print("tname");

prints '/foo/bar//prefiR5uKI4'

It'd be nice if the first argument was checked for a final '/' before creating the file name.

Thanks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-27 21:46 UTC] elixer@php.net
The sample code you provide works perfectly for me.  Try with the latest cvs snapshot (http://snaps.php.net/) and see if that fixes it on your end.

Sean
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 27 15:01:29 2024 UTC