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

Submitter:  Matt McCutchen <hashproduct>
Submitted:  Sat 07 Apr 2007 03:37:51 PM UTC
Votes: 60
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Mon 09 Mar 2015 10:44:09 PM UTC, comment #4: 

This was fixed as described in:

http://bugs.gnu.org/14371

Paul Eggert <eggert>
Group administrator
Sun 14 Feb 2010 02:18:15 AM UTC, 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 28 Nov 2009 03:42:29 AM UTC, 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 09 Apr 2007 06:14:29 PM UTC, 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

See:

http://www.opengroup.org/susv3/utilities/mkdir.html

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>
Group administrator
Sat 07 Apr 2007 03:37:51 PM UTC, 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #19699:  coreutils-mkdir-p-defacl-hack.diff added by hashproduct (2KiB - 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
  • -email is unavailable- added by chewi
  • -email is unavailable- added by mjo
  • -email is unavailable- added by hashproduct (Voted in favor of this item)
  • -email is unavailable- added by eggert (Posted a comment)
  • -email is unavailable- added by hashproduct (Submitted the item)
  •  

    There are 60 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-09 eggert StatusNone Fixed
        Open/ClosedOpen Closed
    2014-09-09 chewi Carbon-Copy- Added chewi
    2012-08-08 mjo Carbon-Copy- Added mjo
    2010-02-14 hashproduct Attached File- Added coreutils-mkdir-p-defacl-hack.diff, #19699
    2009-11-28 hashproduct Carbon-Copy- Added hashproduct
    2007-04-09 eggert Severity3 - Normal 1 - Wish

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code