diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-03-18 08:18:12 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-18 08:18:12 +0100 |
commit | 3bc47188b749b2717fff135e39de55baff79560f (patch) | |
tree | 59a525f61a60c229aede4c7c1b69e01b8c12f0e9 | |
parent | 2d04286793281328d02985aeaab75b5798f58f95 (diff) | |
download | curl-bagder/create-files-mode.tar.gz |
curl: make --create-dirs use mode 0777 for new directoriesbagder/create-files-mode
... and trust that people's umask will "trim" it.
Reported-by: David Lindes
Fixes #6757
-rw-r--r-- | docs/cmdline-opts/create-dirs.d | 3 | ||||
-rw-r--r-- | src/tool_dirhie.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/docs/cmdline-opts/create-dirs.d b/docs/cmdline-opts/create-dirs.d index 48a8fd466..26069836e 100644 --- a/docs/cmdline-opts/create-dirs.d +++ b/docs/cmdline-opts/create-dirs.d @@ -7,6 +7,7 @@ necessary local directory hierarchy as needed. This option creates the dirs mentioned with the --output option, nothing else. If the --output file name uses no dir or if the dirs it mentions already exist, no dir will be created. -Created dirs are made with mode 0750 on unix style file systems. +Created dirs are made with mode 0777 on unix style file systems and umask is +in effect. Older versions used mode 0750. To create remote directories when using FTP or SFTP, try --ftp-create-dirs. diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index bf11005e0..ed5302095 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -153,7 +153,7 @@ CURLcode create_dir_hierarchy(const char *outfile, FILE *errors) msnprintf(dirbuildup, outlen, "%s%s", DIR_CHAR, tempdir); } /* Create directory. Ignore access denied error to allow traversal. */ - if(!skip && (-1 == mkdir(dirbuildup, (mode_t)0000750)) && + if(!skip && (-1 == mkdir(dirbuildup, (mode_t)0000777)) && (errno != EACCES) && (errno != EEXIST)) { show_dir_errno(errors, dirbuildup); result = CURLE_WRITE_ERROR; |