summaryrefslogtreecommitdiff
path: root/src/remove.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-07-04 12:06:49 +0000
committerJim Meyering <jim@meyering.net>2002-07-04 12:06:49 +0000
commit2afe4a16773fddd77bf60d21cd49d715264d5a1d (patch)
tree2831e27ed6762e1ad9965c729d50a5352291761f /src/remove.c
parentb645ebf086c5f4a895e21606cd9671adb657942a (diff)
downloadcoreutils-2afe4a16773fddd77bf60d21cd49d715264d5a1d.tar.xz
(prompt): Fix test for write-protectedness to also
check errno == EACCES. Otherwise, `rm dangling-symlink' would mistakenly prompt.
Diffstat (limited to 'src/remove.c')
-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;