gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 130/153: curl: fix time-of-check, time-of-use race


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 130/153: curl: fix time-of-check, time-of-use race in dir creation
Date: Tue, 11 Sep 2018 12:53:21 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit f16bed0c45dc63864fe2097b7df939276d96d62b
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Aug 24 10:01:42 2018 +0200

    curl: fix time-of-check, time-of-use race in dir creation
    
    Patch-by: Jay Satiro
    Detected by Coverity
    Fixes #2739
    Closes #2912
---
 src/tool_dirhie.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c
index a01f9dc5f..36c06941c 100644
--- a/src/tool_dirhie.c
+++ b/src/tool_dirhie.c
@@ -139,12 +139,10 @@ CURLcode create_dir_hierarchy(const char *outfile, FILE 
*errors)
         else
           snprintf(dirbuildup, outlen, "%s%s", DIR_CHAR, tempdir);
       }
-      if(access(dirbuildup, F_OK) == -1) {
-        if(-1 == mkdir(dirbuildup, (mode_t)0000750)) {
-          show_dir_errno(errors, dirbuildup);
-          result = CURLE_WRITE_ERROR;
-          break; /* get out of loop */
-        }
+      if((-1 == mkdir(dirbuildup, (mode_t)0000750)) && (errno != EEXIST)) {
+        show_dir_errno(errors, dirbuildup);
+        result = CURLE_WRITE_ERROR;
+        break; /* get out of loop */
       }
     }
     tempdir = tempdir2;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]