From 6ef62b386b398cac6e7285657d7bbf4e7cf98a5c Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Tue, 16 Oct 2001 04:13:29 +0000 Subject: 16062: use O_EXCL when opening a temporary file. --- Src/Modules/zftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Src/Modules') 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. */ -- cgit 1.4.1