From 60325ac322e9ddcee581609498c0ebaebcfdf1b7 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 2 Jan 2013 18:39:30 +0100 Subject: [PATCH] Use mkstemp instead of mktemp --- etc/afpd/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/afpd/file.c b/etc/afpd/file.c index e33b0e3a..7f0e234a 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -2111,11 +2111,13 @@ int afp_exchangefiles(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U * NOTE: the temp file will be in the dest file's directory. it * will also be inaccessible from AFP. */ memcpy(temp, APPLETEMP, sizeof(APPLETEMP)); - if (!mktemp(temp)) { + int fd; + if ((fd = mkstemp(temp)) == -1) { err = AFPERR_MISC; goto err_exchangefile; } - + close(fd); + if (crossdev) { /* FIXME we need to close fork for copy, both s_of and d_of are null */ ad_close(adsp, ADFLAGS_HF); -- 2.39.2