bugGNU Core Utilities - Bugs: bug #19546, mkdir -p should use default ACL...


You are not allowed to post comments on this tracker with your current authentication level.

bug #19546: mkdir -p should use default ACL for parent directories

Submitted by:  Matt McCutchen <hashproduct>
Submitted on:  Sat Apr 7 15:37:51 2007  
Votes:  60  
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon Mar 9 22:44:09 2015, comment #4:

This was fixed as described in:


Paul Eggert <eggert>
Project Administrator
Sun Feb 14 02:18:15 2010, comment #3:

This could be considered one part of bug #28891.

For now, I've written a simple, hacky patch (attached) that makes "mkdir -p" unconditionally observe default ACLs for ancestor directories but does not change the behavior for the actual argument directory. This should be enough for "mkdir -p -m 755" to give usable permissions when installing software. Others might wish to use this patch until a complete solution is available.

(file #19699)

Matt McCutchen <hashproduct>
Sat Nov 28 03:42:29 2009, comment #2:

I don't take that text in the standard literally. In the hypothetical "POSIX plus abandoned POSIX ACLs" standard that we're implementing, I feel certain it would have been changed to account for default ACLs.

I really doubt that a user who applies a default ACL to a directory would then rely on mkdir honoring the umask in preference to the default ACL. But if you're genuinely worried about breakage, I would be happy to have a new option, or preferably a new environment variable that I could set globally. This issue causes me pain every time I install software from source: since I use umask 0077, installs into a shared directory with an appropriate default ACL are unusable by others until I go and change the permissions manually.

Matt McCutchen <hashproduct>
Mon Apr 9 18:14:29 2007, comment #1:

Sorry, but POSIX requires that "mkdir -p FOO/BAR" must create FOO as if by the following command:

mkdir -m $(umask -S),u+wx FOO



It might make sense to add the behavior you desire, as a new option to mkdir, but I'd have some qualms about changing the existing, standard behavior, as people may be relying on it.

Paul Eggert <eggert>
Project Administrator
Sat Apr 7 15:37:51 2007, original submission:

I would like mkdir -p to observe the default ACL in preference to the umask (as nearly all other programs do) when creating parent directories.

To reproduce, run this in an empty directory on a filesystem with ACLs enabled:
umask 0077
setfacl -dm u::rwx,g::rwx,o::rwx .
mkdir foo
mkdir -p bar/baz
ls -l

Actual result:
total 0
drwx------+ 3 matt matt 72 Apr 7 11:32 bar
drwxrwxrwx+ 2 matt matt 48 Apr 7 11:32 foo

Desired result:
total 0
drwxrwxrwx+ 3 matt matt 72 Apr 7 11:32 bar
drwxrwxrwx+ 2 matt matt 48 Apr 7 11:32 foo

Matt McCutchen <hashproduct>


Attached Files
file #19699:  coreutils-mkdir-p-defacl-hack.diff added by hashproduct (2kB - application/octet-stream - Hacky patch to observe default ACL for parent directories)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by chewi
  • -unavailable- added by mjo
  • -unavailable- added by hashproduct (Voted in favor of this item)
  • -unavailable- added by eggert (Posted a comment)
  • -unavailable- added by hashproduct (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 60 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Mar 9 22:44:09 2015eggertStatusNone=>Fixed
    Tue Sep 9 11:18:59 2014chewiCarbon-Copy-=>Added chewi
    Wed Aug 8 14:46:08 2012mjoCarbon-Copy-=>Added mjo
    Sun Feb 14 02:18:15 2010hashproductAttached File-=>Added coreutils-mkdir-p-defacl-hack.diff, #19699
    Sat Nov 28 03:50:26 2009hashproductCarbon-Copy-=>Added hashproduct
    Mon Apr 9 18:14:29 2007eggertSeverity3 - Normal=>1 - Wish

    Back to the top

    Powered by Savane 3.1-cleanup1