]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl: set CURLOPT_NEW_FILE_PERMS if requested
authorDaniel Stenberg <daniel@haxx.se>
Fri, 26 Feb 2021 10:18:09 +0000 (11:18 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 26 Feb 2021 23:30:36 +0000 (00:30 +0100)
The --create-file-mode code logic accepted the value but never actually
passed it on to libcurl!

Follow-up to a7696c73436f (shipped in 7.75.0)
Reported-by: Johannes Lesr
Fixes #6657
Closes #6666

src/tool_operate.c

index f36f3ce530e32f5f3f2918227af86682495afaf7..2aebb9ac2c6d038640912b300025111a3b3d1293 100644 (file)
@@ -2001,6 +2001,9 @@ static CURLcode single_transfer(struct GlobalConfig *global,
         if(config->ftp_pret)
           my_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
 
+        if(config->create_file_mode)
+          my_setopt(curl, CURLOPT_NEW_FILE_PERMS, config->create_file_mode);
+
         if(config->proto_present)
           my_setopt_flags(curl, CURLOPT_PROTOCOLS, config->proto);
         if(config->proto_redir_present)