Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I copy a file with a base ACL of:


into a directory with a default ACL of:


I obtain a file with mask of m::r--. I would have expected the union of the permissions of the two group entries (i.e. m::rwx).

Why it is so? Does it depend on the mode parameter used by cp in the creation of the file?

share|improve this question
up vote 4 down vote accepted

(I assume you're working on Linux, the workings of ACLs differ between unix variants.)

cp doesn't do anything special when you copy the file; it creates the file with the mode of the original file, masked by the mask of the directory. Since cp doesn't do anything to the file's mask, the mask ends up being the intersection of the directory mask (rwx) and the file's group permissions (r).

open("dir/file", O_WRONLY|O_CREAT|O_EXCL, 0644)
share|improve this answer
When one has set the default ACL (which is passed on to newly created subfolders), how does the mask + default acl + folder perms get fused together, when a new subfolder is created??? – nass Aug 6 '13 at 12:03
@nass The default ACL is used if no ACL has been set explicitly. If there's an explicit ACL then its mask is used, otherwise the default mask is used. – Gilles Aug 6 '13 at 12:08
I am abit fuzzy about the mask acl. if I set an explicit acl to a folder, I expect this to be followed. you tell me that regardless of my explicit acl, the actual perms will be the intersection of the mask with the acl? and when I set a default acl then that is taken as is (ie without intersection with the mask acl?) may I also refer you to a question I have here unix.stackexchange.com/questions/85633/… – nass Aug 6 '13 at 12:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.