Parcourir la source

* fchmod() to avoid a race condition

svn: 1349
Bryan Drewery il y a 22 ans
Parent
commit
6fd70b7218
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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;