We are moving our web files from AFS to a local volume with the acl flag set. We use extended ACLs for our permissions so users can edit different parts of our websites. In AFS, when you create a new file it inherits its parent's permissions.

How do we make it so that when users create new files in their web directories, those files inherit the parent's facl? (Which includes www-data) If it helps, we run Gentoo Linux.

  • what filesystem are you using in your local volume? – c4f4t0r Nov 25 '13 at 23:15
  • ext4 (with the acl flag in fstab) – Vacation9 Nov 25 '13 at 23:22
  • if you check my answer you can see a link some example – c4f4t0r Nov 25 '13 at 23:24

On linux many filesystems support posix acl, for more information you look this link http://users.suse.com/~agruen/acl/linux-acls/online/,if you have many directories and you wanna apply the acls on subdirs

 -R, --recursive
       Apply operations to all files and directories recursively. This option cannot be mixed with ‘--restore’.

But if you wanna the acl are apply on files and directories on creationes time, you need the defaults acls on directory

 setfacl -d -m user:user01:rwx dir
  • We are using posix/extended acls. What we want to do is have these apply recursively, as normal acls do, upon creation of a new file in that directory. – Vacation9 Nov 25 '13 at 23:27
  • Alright, if new directories are created in the directory with default acls set will they also inherit those defaults? Or will the defaults apply at any depth? – Vacation9 Nov 25 '13 at 23:49
  • yes, i tried now and i can tell it work, if you set the default acl on a directory, the subdir inherit the acl from parent dir and default too – c4f4t0r Nov 25 '13 at 23:53
  • Note that this will work for new or copied files, but not for moved files. Moving keeps the existing ACLs, even if the destination has "default" ACLs set on it... – David Gardner Jan 28 at 12:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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