php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66591 Compilation warning: the use of `tmpnam' is dangerous, better use `mkstemp'
Submitted: 2014-01-27 22:08 UTC Modified: 2014-01-29 07:38 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: sixd@php.net Assigned: krakjoe (profile)
Status: Closed Package: phpdbg
PHP Version: 5.6Git-2014-01-27 (Git) OS: Linux
Private report: No CVE-ID: None
 [2014-01-27 22:08 UTC] sixd@php.net
Description:
------------
Compiling PHP 5.6 on Oracle Linux 5.10 (equivalent to RHEL 5.10) gives the following warning:

sapi/phpdbg/phpdbg.o: In function `main':
sapi/phpdbg/phpdbg.c:875: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

The compiler is: gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)


Patches

kill-tmpnam-usage.patch (last revision 2014-01-28 11:37 UTC by ondrej@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-28 11:19 UTC] ondrej@php.net
The following patch has been added/updated:

Patch Name: kill-tmpnam-usage.patch
Revision:   1390907962
URL:        https://bugs.php.net/patch-display.php?bug=66591&patch=kill-tmpnam-usage.patch&revision=1390907962
 [2014-01-28 11:37 UTC] ondrej@php.net
The following patch has been added/updated:

Patch Name: kill-tmpnam-usage.patch
Revision:   1390909065
URL:        https://bugs.php.net/patch-display.php?bug=66591&patch=kill-tmpnam-usage.patch&revision=1390909065
 [2014-01-28 23:11 UTC] sixd@php.net
The use of a hardcoded "/tmp" in the latest iteration of the patch looks like an undesired portability issue.
 [2014-01-29 07:38 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-01-29 07:38 UTC] krakjoe@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This is fixed in phpdbg master, which will be merged into php-src tree before the next alpha.

Windows is still using tmpnam, I'll patch that when I've tested in windows, can't do that today ...
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 07:01:25 2020 UTC