]> arthur.barton.de Git - netatalk.git/commitdiff
Use mkstemp instead of mktemp
authorRalph Boehme <sloowfranklin@gmail.com>
Wed, 2 Jan 2013 17:39:30 +0000 (18:39 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Wed, 2 Jan 2013 17:39:30 +0000 (18:39 +0100)
etc/afpd/file.c

index e33b0e3a2b593575cc8467d9975c4e02ebf3ed91..7f0e234a5defc6163fb10d3aaf06011619566072 100644 (file)
@@ -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);