I have a directory that already might have some subdirectory configured rwx
for www-data
, but I want to make a final pass and ensure www-data
has a full read access on the full directory.
All these are part of some bash scripting, and I need to automate this.
Ideally, I want to do:
chmod g+r /my/root/dir -R
But, of course, I'm using ACL, and I want to do it only for group www-data
.
But using setfacl
will overwrite the previous permissions. It doesn't support +r
notation for relative permission settings (and it is not documented in the man
page):
$ setfacl -m g:www-data:+r /tmp
setfacl: Option -m: Invalid argument near character 12
How can I do that ? Shall I resort to nasty scripting solutions ?
It seems that there's a version of setfacl
that support that in some Unix:
https://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxa500/sfacl.htm , it was also reported working on SuSE.
EDIT: I'm on an Ubuntu 15.10, my version of setfacl
comes from a package named acl
in version 2.2.52-2
.