Summary: | [Build] "Dangerous" mktemp warning | ||
---|---|---|---|
Product: | binutils | Reporter: | Mohammed Adnène Trojette <adn> |
Component: | binutils | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | bug-binutils, robert |
Priority: | P2 | ||
Version: | 2.18 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: |
Patch to replace mktemp with mkstemp
new mkstemp/mkdtemp patch |
Description
Mohammed Adnène Trojette
2006-07-04 18:25:23 UTC
Created attachment 1135 [details]
Patch to replace mktemp with mkstemp
Hi Mohammed, This is a known problem, but your fix will not work. For a discussion of why, please see this thread: http://sourceware.org/ml/binutils/2003-07/msg00009.html Cheers Nick Created attachment 1360 [details]
new mkstemp/mkdtemp patch
I made this patch from OpenBSD-cvs Binutils source, and added some autoconf
stuff so mktemp(3) will be used if the system does not have mkstemp/mkdtemp(3).
This patch should allow systems with mkstemp/mkdtemp to use them while staying
portable to systems without mkstemp.
Reopen bug with proposed patch (request for comments). Hi Robert, Thanks for the patch. I have tidied it up slightly and applied it along with this ChangeLog entry. Cheers Nick binutils/ChangeLog 2006-10-13 Robert Connolly <robert@linuxfromscratch.org> PR binutils/2876 * configure.in: Check for the mkstemp and mkdtemp functions. * configure: Regenerate. * config.in (HAVE_MKDTEMP): New potential define. (MAKE_MKSTEMP): Likewise. * bucomm.c (make_tempname): Use mkstemp if it is available. (make_tempdir): New function: Create a temporary directory using mkdtemp, if it is available. * bucomm.h (make_tempdir): New prototype. * objcopy.c (copy_archive): Use make_tempdir if it is available. (strip_main): Produce an warning message if a temporary file could not be created. (copy_main): Likewise. * ar.c (write_archive): Likewise. |