mirror of
git://git.sv.gnu.org/coreutils
synced 2026-06-06 07:42:21 -04:00
(prompt): Fix test for write-protectedness to also
check errno == EACCES. Otherwise, `rm dangling-symlink' would mistakenly prompt.
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user