(prompt): Fix test for write-protectedness to also

check errno == EACCES.  Otherwise, `rm dangling-symlink' would
mistakenly prompt.
This commit is contained in:
Jim Meyering
2002-07-04 12:06:49 +00:00
parent b645ebf086
commit 2afe4a1677
+1 -1
View File
@@ -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;