about summary refs log tree commit diff
path: root/Src/Modules/zftp.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-10-16 04:13:29 +0000
committerClint Adams <clint@users.sourceforge.net>2001-10-16 04:13:29 +0000
commit6ef62b386b398cac6e7285657d7bbf4e7cf98a5c (patch)
treeeae60bb16be9cb6aaf0bdbdbf81bc079d66f5930 /Src/Modules/zftp.c
parent925f36d6d3ebddbca4e8322e5197852a4d63b291 (diff)
downloadzsh-6ef62b386b398cac6e7285657d7bbf4e7cf98a5c.tar.gz
zsh-6ef62b386b398cac6e7285657d7bbf4e7cf98a5c.tar.xz
zsh-6ef62b386b398cac6e7285657d7bbf4e7cf98a5c.zip
16062: use O_EXCL when opening a temporary file.
Diffstat (limited to 'Src/Modules/zftp.c')
-rw-r--r--Src/Modules/zftp.c2
1 files changed, 1 insertions, 1 deletions
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. */