2

I am trying to set up ACL's so that all new sub-directories and files withing a directory automatically inherit it's parents permissions. From what I understand I could achieve this by setting the default permissions for all groups and users, this is what I did:

mkdir test 
chown root:media test
chmod 775 test
chmod g+s test (so all directories and files are in the same group)
setfacl -dm g::rwx test
getfacl test

Here is the output of the last command:

# file: test
# owner: dom
# group: media
# flags: -s-
user::rwx
group::rwx
other::r-x 
default:user::rwx
default:group::rwx
default:other::r-x

All seems correct but when I create files withing thest directory they do not have correct permissions.

cd test
mkdir dir
touch file
ls -l

Here are the results of the last command:

root@Server:/test# ls -l
total 4 
drwxrwsr-x+ 2 root media 4096 Oct 27 19:24 dir
-rw-rw-r--  1 root media    0 Oct 27 19:24 file

I am using Ubuntu Server 14.04 with on ext4 file system.

Ac you can see the directory has the correct permissions but the file is missing execute permissions. I have also tried this on another directory (/mnt/disk1) and the file was missing read permissions also. What am I doing wrong?

  • This page says a three-year-old bug makes ACLs ineffective. Could that be your issue? – muru Oct 28 '14 at 23:22
  • @muru that's unbelievable. Does it mean you simply cannot have ACL defaults in linux no matter what? – DominicM Oct 29 '14 at 0:45
  • Sorry, I really don't know much about ACLs, but that notice is present very prominently in the wiki page, so I figured it might be what you are facing. – muru Oct 29 '14 at 0:55
1

With no other answer I am adding my answer since the issue has been somewhat resolved.

Due to a three year old (!) cp/mv in coreutils don't respect the default ACL of parent directories bug the default ACL permission are non-functional and the reason acl's did not work for me.

  • How has this issue been resolved? Is there a launchpad bug for this issue? – Eyal Dec 16 '14 at 12:35
  • The question is resolved but not the bug, the solution is simply not to use ACL as it is broken and since it broken for 3+ years there's no reason to believe it will be fixed soon. – DominicM Dec 17 '14 at 15:56
  • What is the solution if we want this behaviour though? What else can we use? – chrismacp Sep 6 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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