[wp-trac] [WordPress Trac] #34562: `wp_tempnam()` can return a path that already exists

WordPress Trac noreply at wordpress.org
Mon Nov 16 05:32:34 UTC 2015


#34562: `wp_tempnam()` can return a path that already exists
----------------------------+---------------------
 Reporter:  dd32            |       Owner:  dd32
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  4.4
Component:  Filesystem API  |     Version:
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:
----------------------------+---------------------
Changes (by dd32):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"35644"]:
 {{{
 #!CommitTicketReference repository="" revision="35644"
 Decrease the chances that `wp_tempnam()` will conflict with an existing
 file by suffixing a random ID to the generated filename.
 This also switches from using `touch()` to using `fopen( $file, 'x')` to
 ensure that we're the process creating the file.

 Fixes #34562
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34562#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list