about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/zftp.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f4b8803d..d25abcbbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-16  Clint Adams  <clint@zsh.org>
+
+	* 16062: Src/Modules/zftp.c: use O_EXCL
+	when opening a temporary file.
+
 2001-10-15  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* 16059: Src/hist.c: Fix HIST_NO_SPACE when
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index b31c522b4..c507a85ce 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -1918,7 +1918,7 @@ zftp_open(char *name, char **args, int flags)
      */
     if (zfstatfd == -1) {
 	fname = gettempname();
-	zfstatfd = open(fname, O_RDWR|O_CREAT, 0600);
+	zfstatfd = open(fname, O_RDWR|O_CREAT|O_EXCL, 0600);
 	DPUTS(zfstatfd == -1, "zfstatfd not created");
 #if defined(F_SETFD) && defined(FD_CLOEXEC)
 	/* If the shell execs a program, we don't want this fd left open. */