From: Nick Clifton <nickc@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] dllwrap, windres and dlltools use mktemp, which should be avoided
Date: Thu, 1 Sep 2022 13:52:18 +0000 (GMT) [thread overview]
Message-ID: <20220901135218.608203858D1E@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f4492fb683013d7de6f4788df6deb24fed8671b4
commit f4492fb683013d7de6f4788df6deb24fed8671b4
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Sep 1 14:51:50 2022 +0100
dllwrap, windres and dlltools use mktemp, which should be avoided
PR 29534
* dllwrap.c: Replace uses of choose_temp_base() with
make_temp_file().
* dlltool.c: Likewise.
* resrc.c: Likewise.
Diff:
---
binutils/ChangeLog | 8 ++++++++
binutils/dlltool.c | 2 +-
binutils/dllwrap.c | 6 +++---
binutils/resrc.c | 4 ++--
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 04ef77c5530..b5711097d50 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-01 Nick Clifton <nickc@redhat.com>
+
+ PR 29534
+ * dllwrap.c: Replace uses of choose_temp_base() with
+ make_temp_file().
+ * dlltool.c: Likewise.
+ * resrc.c: Likewise.
+
2022-08-23 Nick Clifton <nickc@redhat.com>
PR 29489
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index b4ac842212a..a3c5e0f778e 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -1270,7 +1270,7 @@ run (const char *what, char *args)
int i;
const char **argv;
char *errmsg_fmt = NULL, *errmsg_arg = NULL;
- char *temp_base = choose_temp_base ();
+ char *temp_base = make_temp_file ("");
inform (_("run: %s %s"), what, args);
diff --git a/binutils/dllwrap.c b/binutils/dllwrap.c
index 1be3cec72f1..7c77701f4e9 100644
--- a/binutils/dllwrap.c
+++ b/binutils/dllwrap.c
@@ -351,7 +351,7 @@ run (const char *what, char *args)
int i;
const char **argv;
char *errmsg_fmt = NULL, *errmsg_arg = NULL;
- char *temp_base = choose_temp_base ();
+ char *temp_base = make_temp_file (NULL);
int in_quote;
char sep;
@@ -818,7 +818,7 @@ main (int argc, char **argv)
if (! def_file_seen)
{
- char *fileprefix = choose_temp_base ();
+ char *fileprefix = make_temp_file (NULL);
def_file_name = (char *) xmalloc (strlen (fileprefix) + 5);
sprintf (def_file_name, "%s.def",
@@ -1031,7 +1031,7 @@ Creating one, but that may not be what you want"));
if (! base_file_name)
{
- char *fileprefix = choose_temp_base ();
+ char *fileprefix = make_temp_file (NULL);
base_file_name = (char *) xmalloc (strlen (fileprefix) + 6);
sprintf (base_file_name, "%s.base",
(dontdeltemps) ? mybasename (fileprefix) : fileprefix);
diff --git a/binutils/resrc.c b/binutils/resrc.c
index fff77f4f28a..2cf168e0f58 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -202,7 +202,7 @@ run_cmd (char *cmd, const char *redir)
int i;
const char **argv;
char *errmsg_fmt = NULL, *errmsg_arg = NULL;
- char *temp_base = choose_temp_base ();
+ char *temp_base = make_temp_file (NULL);
int in_quote;
char sep;
int redir_handle = -1;
@@ -316,7 +316,7 @@ open_input_stream (char *cmd)
{
char *fileprefix;
- fileprefix = choose_temp_base ();
+ fileprefix = make_temp_file (NULL);
cpp_temp_file = (char *) xmalloc (strlen (fileprefix) + 5);
sprintf (cpp_temp_file, "%s.irc", fileprefix);
free (fileprefix);
reply other threads:[~2022-09-01 13:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220901135218.608203858D1E@sourceware.org \
--to=nickc@sourceware.org \
--cc=bfd-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).