[Top][All Lists]

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

Re: mkdir -p and Default ACLs

From: Jan Engelhardt
Subject: Re: mkdir -p and Default ACLs
Date: Sun, 27 Jul 2008 06:37:54 +0200 (CEST)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

On Saturday 2008-07-26 00:31, Paul Eggert wrote:
>> Using 0755 is what I deem the bug, and 0777 is what I think is 
>> correct.
>But mkdir -p also invokes umask, so the two should be equivalent.
>Here's the behavior I see with coreutils 6.12 on Debian stable (no ACLs):
>   $ umask
>   0022
>   $ strace -e mkdir,umask mkdir test1
>   mkdir("test1", 0777)                    = 0
>   $ strace -e mkdir,umask mkdir -p test2
>   umask(0)                                = 022
>   mkdir("test2", 0755)                    = 0
>mkdir("test1", 0777) with umask 022 ought to be equivalent to
>mkdir("test2", 0755) with umask 0.  If it isn't equivalent, that
>suggests something is dodgy with your ACL implementation.

Your ACL implementation would then be just as dodgy, because I am on 
Linux too. And the userspace libacl does not even come into play. The 
effects can already be observed right after the syscall.

umask specifies what bits to remove from the user, group and others. The 
mode parameter however modifies the final mode -- and the "group" bits 
in the mode are mapped to the ACL mask when an ACL is in place, not to 
the real group bits!

One could argue that the mode parameter should be interpreted 
differently in the kernel to map to group instead of ACL mask during 
create operations, but I suppose the Linux kernel people would say they 
won't change to not possibly break existing programs (though I would 
wonder who would rely on the group bits mapping to ACL mask in presence 
of ACL anyway).

reply via email to

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