-
-
Notifications
You must be signed in to change notification settings - Fork 319
Description
We are using file access control lists (ACLs) on our Linux systems because otherwise, we are not able to delete web server created files (e.g. caches or session files) with a non-root CLI script.
Example: we use setfacl on our cache directory like
setfacl -R -m u:www-data:rwX -m u:some-user:rwX cache
If the web server (www-data) is creating files in that folder, it looks like this
$ ll cache/
total 556
drwxrwxrwx+ 1 www-data www-data 11026 Jul 3 09:37 ./
drwxrwxrwx+ 1 www-data www-data 16 Jul 3 09:18 ../
-rw-------+ 1 www-data www-data 796 Jul 3 08:52 some_file
or with getfacl cache/some_file like this
$ getfacl cache/some_file
# file: some_file
# owner: www-data
# group: www-data
user::rw-
user:www-data:rwx #effective:---
user:some-user:rwx #effective:---
group::rwx #effective:---
mask::---
other::---
Currently those files cannot be delete using DeleteTask like
<delete includeemptydirs="true">
<fileset dir="cache/">
<include name="**/*" />
</fileset>
</delete>
even though some-user is able to delete those files on the console. The only unusual thing is just, that the console is confirming the removal, if rm is used without -f option
$ rm cache/some_file
rm: remove write-protected regular file 'cache/some_file'?
Alternatively you could also use rm -f cache/some_file to aviod the confirmation and the file is removed immediately.
Would it be possible to enable DeleteTask to delete ACLs (unprotected) files as well? Maybe with an attribute to "force" the delete? (force = true, default = false)