Sfoglia il codice sorgente

* fchmod() to avoid a race condition

svn: 1349
Bryan Drewery 22 anni fa
parent
commit
6fd70b7218
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/misc_file.c

+ 1 - 1
src/misc_file.c

@@ -180,7 +180,7 @@ void Tempfile::MakeTemp()
   if ((f = fdopen(fd, "w+b")) == NULL)
     goto error;
   
-  chmod(file, S_IRUSR | S_IWUSR);
+  fchmod(fd, S_IRUSR | S_IWUSR);
 
   return;