Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

file: use fdopen() for uploaded files if available

It eliminates noisy events when using inotify and fixes a TOCTOU issue.

Bug: https://bugzilla.redhat.com/844385
  • Loading branch information...
commit 1f8518c5d9aaa369dae85620973f9b5c1add3277 1 parent a52857c
Kamil Dudka kdudka authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/file.c
4 lib/file.c
View
@@ -351,8 +351,12 @@ static CURLcode file_upload(struct connectdata *conn)
failf(data, "Can't open %s for writing", file->path);
return CURLE_WRITE_ERROR;
}
+#ifdef HAVE_FDOPEN
+ fp = fdopen(fd, "wb");
+#else
close(fd);
fp = fopen(file->path, "wb");
+#endif
}
if(!fp) {
Please sign in to comment.
Something went wrong with that request. Please try again.