8

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.

Vacation9
  • 113
  • 1
  • 1
  • 8

1 Answers1

8

On Linux, many filesystems support posix acl.

If you have many directories and you want to 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 want the acl are apply on files and directories on creation time, you need the defaults acls on directory

 setfacl -d -m user:user01:rwx dir
c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
  • 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
  • 1
    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
  • 1
    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 '19 at 12:44