bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in permissions after mkdir -p -m


From: Jim Meyering
Subject: Re: bug in permissions after mkdir -p -m
Date: 25 Apr 2001 18:30:34 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]