Setfacl:删除 ACL 使我的文件可执行

Setfacl:删除 ACL 使我的文件可执行

我正在编写一个脚本来添加和删除第三方 unix 帐户的 ACL。

添加 ACL 非常有效。

删除有效,但使子用户创建的文件可执行。请参阅:

~/test$ mkdir directory
~/test$ setfacl -Rm u:www-data:rwX directory
~/test$ setfacl -Rdm u:www-data:rwX directory
~/test$ getfacl directory
# file: directory
# owner: sullivan
# group: sullivan
user::rwx
user:www-data:rwx
group::rwx
mask::rwx
other::r-x
default:user::rwx
default:user:www-data:rwx
default:group::rwx
default:mask::rwx
default:other::r-x

~/test$ sudo su www-data -s /bin/bash
www-data@sweetnexy:/home/sullivan/test$ touch directory/file
www-data@sweetnexy:/home/sullivan/test$ exit
exit
~/test$ ls -l directory/
total 0
-rw-rw-r--+ 1 www-data www-data 0 juin   2 16:10 file
~/test$ sudo setfacl -Rx u:www-data directory
~/test$ sudo setfacl -Rdx u:www-data directory
~/test$ ls -l directory/
total 0
-rw-rwxr--+ 1 www-data www-data 0 juin   2 16:10 file

如您所见,toto/file现在该组具有可执行权限。

权限为何改变?如何避免?

谢谢。

相关内容