Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC issues warning: the use of 'tmpnam' is dangerous, better use 'mkstemp' #137

Closed
1100110 opened this issue Nov 26, 2012 · 2 comments
Closed
Assignees

Comments

@1100110
Copy link
Contributor

1100110 commented Nov 26, 2012

.../vibe.d/bin/../source/vibe/core/file.d:43: warning: the use of tmpnam' is dangerous, better usemkstemp'

I have no idea whether or not this is something that should be changed, so I thought I'd point it out as I never saw this warning before.

@1100110
Copy link
Contributor Author

1100110 commented Nov 26, 2012

https://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html has this to say:

Warning: Between the time the pathname is constructed and the file is created another process might have created a file with the same name using tmpnam, leading to a possible security hole. The implementation generates names which can hardly be predicted, but when opening the file you should use the O_EXCL flag. Using tmpfile or mkstemp is a safe way to avoid this problem.

@ghost ghost assigned s-ludwig Jan 13, 2013
@Abscissa
Copy link

Abscissa commented Feb 5, 2013

I get the same warning on Linux using DMD.

s-ludwig added a commit that referenced this issue Feb 9, 2013
… of tmpnam(). Fixes issue #137.

This is checked in from a Windows box, so still needs actual testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants