From ef7db53265491e1170d3475d7795fa8d3c462031 Mon Sep 17 00:00:00 2001 From: Russell Harmon Date: Thu, 7 Jan 2016 23:37:39 -0800 Subject: [PATCH] Created SC2174 (markdown) --- SC2174.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 SC2174.md diff --git a/SC2174.md b/SC2174.md new file mode 100644 index 0000000..11b6b4b --- /dev/null +++ b/SC2174.md @@ -0,0 +1,13 @@ +## -m will be ignored for parent directories + +### Problematic code: + +```sh +mkdir -p -m 0755 foo/bar/baz +``` + +### Rationale: + +When using `-m 0755`, the mode of the directory created will be set to 0755. When using `-p`, parent directories which do not exist will be created, but the mode specified by `-m` will only be used on the non-parent directory. The parent directories will get their access mode the default way, via [umask(2)]. + +[umask(2)]: http://man7.org/linux/man-pages/man2/umask.2.html \ No newline at end of file