Created SC2174 (markdown)

Russell Harmon
2016-01-07 23:37:39 -08:00
parent 512f767bf1
commit ef7db53265

13
SC2174.md Normal file

@@ -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