From 2afe4a16773fddd77bf60d21cd49d715264d5a1d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Jul 2002 12:06:49 +0000 Subject: (prompt): Fix test for write-protectedness to also check errno == EACCES. Otherwise, `rm dangling-symlink' would mistakenly prompt. --- src/remove.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-54-g00ecf