summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/remove.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/remove.c b/src/remove.c
index bd1989f6c..394e4c484 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -560,7 +560,7 @@ prompt (char const *filename, struct rm_options const *x,
*is_dir = T_UNKNOWN;
if ((!x->ignore_missing_files && (x->interactive || x->stdin_tty)
- && (write_protected = euidaccess (filename, W_OK)))
+ && (write_protected = (euidaccess (filename, W_OK) && errno == EACCES)))
|| x->interactive)
{
struct stat sbuf;