1

This scratch file was created by apache

-rw-rw-r--+  1 apache apache   1960 Nov 16  2019 zlz7v5y9.php

When executing the following:

-bash-4.2$ rm zlz7v5y9.php

I get:

rm: cannot remove ‘zlz7v5y9.php’: Permission denied

Here are the permissions:

-bash-4.2$ getfacl zlz7v5y9.php
# file: zlz7v5y9.php
# owner: apache
# group: apache
user::rw-
user:tomr:rwx               #effective:rw-
user:subtum:rwx             #effective:rw-
group::rwx                  #effective:rw-
mask::rw-
other::r--

Oddly, I CAN edit the file but cannot delete it.

Why am I getting "Permission denied" when trying to delete this file?

UPDATE: Reissuing the setfacl command for a single user fixed the issue for BOTH users. Apparently the ACL system had died and setfacl woke it up? Even though it is working correctly now, I would like to know how this happened for the future. BTW, this is on a system that has had the same ACL config for years and suddenly it stopped working with no changes.

  • Interesting fix. Never seen that happen before with POSIX File ACLs – fpmurphy May 25 at 8:19
0

The File deletion is based on directory perms, not the file perms.

Did you check the directory permission (write)?

Note: You can have a directory where you enforce that only the owner of the file can delete it. This is useful for temp dirs.

Also, please check whether this directory have any "sticky" aka "restricted deletion" mode set (o+t). With this mode set, only the file's owner can move or delete files in that directory, regardless of any perms.

| improve this answer | |
  • Thank you for the reply but please read the "UPDATE" part of the question. This system has been working correctly for years. No changes. The "fix" was to execute setfacl on one of the users and everything works correctly again. No perms were modified. – Tim Duncklee May 24 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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