GNUPG-1-9-BRANCH gnupg/tools (ChangeLog symcryptrun.c)
cvs user wk
cvs at cvs.gnupg.org
Mon Apr 11 19:06:22 CEST 2005
Date: Monday, April 11, 2005 @ 19:22:23
Author: wk
Path: /cvs/gnupg/gnupg/tools
Tag: GNUPG-1-9-BRANCH
Modified: ChangeLog symcryptrun.c
(confucius_mktmpdir): Changed to use mkdtmp(3).
---------------+
ChangeLog | 4 ++++
symcryptrun.c | 29 +++++++----------------------
2 files changed, 11 insertions(+), 22 deletions(-)
Index: gnupg/tools/ChangeLog
diff -u gnupg/tools/ChangeLog:1.25.2.67 gnupg/tools/ChangeLog:1.25.2.68
--- gnupg/tools/ChangeLog:1.25.2.67 Mon Apr 11 18:21:49 2005
+++ gnupg/tools/ChangeLog Mon Apr 11 19:22:23 2005
@@ -1,3 +1,7 @@
+2005-04-11 Werner Koch <wk at g10code.com>
+
+ * symcryptrun.c (confucius_mktmpdir): Changed to use mkdtmp(3).
+
2005-04-11 Marcus Brinkmann <marcus at g10code.de>
* symcryptrun.c: Implement config file parsing.
Index: gnupg/tools/symcryptrun.c
diff -u gnupg/tools/symcryptrun.c:1.1.2.2 gnupg/tools/symcryptrun.c:1.1.2.3
--- gnupg/tools/symcryptrun.c:1.1.2.2 Mon Apr 11 01:54:39 2005
+++ gnupg/tools/symcryptrun.c Mon Apr 11 19:22:23 2005
@@ -227,32 +227,17 @@
static char *
confucius_mktmpdir (void)
{
- int res;
- char *tmpdir;
+ char *name;
- tmpdir = tmpnam (NULL);
- if (!tmpdir)
- {
- log_error (_("cannot create temporary directory name: %s\n"),
- strerror (errno));
- return NULL;
- }
- tmpdir = strdup (tmpdir);
- if (!tmpdir)
- {
- log_error (_("cannot copy temporary directory name: %s\n"),
- strerror (errno));
- return NULL;
- }
- res = mkdir (tmpdir, 0700);
- if (res < 0)
+ name = strdup ("/tmp/gpg-XXXXXX");
+ if (!name || !mkdtemp (name))
{
- log_error (_("cannot create temporary directory %s: %s\n"),
- tmpdir, strerror (errno));
+ log_error (_("can't create temporary directory `%s': %s\n"),
+ name?name:"", strerror (errno));
return NULL;
}
- return tmpdir;
+ return name;
}
@@ -702,7 +687,7 @@
tmpdir = confucius_mktmpdir ();
if (!tmpdir)
return 1;
-
+
/* TMPDIR + "/" + "in" + "\0". */
infile = malloc (strlen (tmpdir) + 1 + 2 + 1);
if (!infile)
More information about the Gnupg-commits
mailing list