diff options
author | Jim Meyering <jim@meyering.net> | 2002-07-04 12:06:49 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-07-04 12:06:49 +0000 |
commit | 2afe4a16773fddd77bf60d21cd49d715264d5a1d (patch) | |
tree | 2831e27ed6762e1ad9965c729d50a5352291761f | |
parent | b645ebf086c5f4a895e21606cd9671adb657942a (diff) | |
download | coreutils-2afe4a16773fddd77bf60d21cd49d715264d5a1d.tar.xz |
(prompt): Fix test for write-protectedness to also
check errno == EACCES. Otherwise, `rm dangling-symlink' would
mistakenly prompt.
-rw-r--r-- | src/remove.c | 2 |
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; |