Thanks for the report, but that's not a bug but rather
the required and documented behavior:

The -m-specified mode isn't used in creating missing `parent' directories.

>From `info mkdir':

`-p'
`--parents'
     Make any missing parent directories for each argument.  The mode
     for parent directories is set to the umask modified by `u+wx'.
     Ignore arguments corresponding to existing directories.

Bert Gijsbers <[EMAIL PROTECTED]> wrote:
| There is a security bug in mkdir when using the -m and -p options.
| If I do this:
|
|     cd /tmp
|     umask 0
|     rm -rf a
|     mkdir -p -m 0755 a/b/c
|     ls -ld a a/b a/b/c
|
| then I get this:
|
| drwxrwxrwx    3 gijsbers users        1024 Apr 25 13:53 a
| drwxrwxrwx    3 gijsbers users        1024 Apr 25 13:53 a/b
| drwxr-xr-x    2 gijsbers users        1024 Apr 25 13:53 a/b/c
|
| I expected to get this:
|
| drwxr-xr-x    3 gijsbers users        1024 Apr 25 13:53 a
| drwxr-xr-x    3 gijsbers users        1024 Apr 25 13:53 a/b
| drwxr-xr-x    2 gijsbers users        1024 Apr 25 13:53 a/b/c

_______________________________________________
Bug-fileutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-fileutils

Reply via email to