From 8d44319fa1cdfaa645465f03bf2ba3ce6cfff098 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 30 Mar 2025 15:16:54 +0100 Subject: [PATCH] ls: suppress ENOENT errors when reading ACL info * src/ls.c (gobble_file): Indicating unknown ACL info with '?' suffices for the edge case of a file being removed while reading, or older cygwin when reading through dangling symlinks. Reported by Corinna Vinschen. --- src/ls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ls.c b/src/ls.c index 46ec42037b..2cf4ee4444 100644 --- a/src/ls.c +++ b/src/ls.c @@ -3538,8 +3538,14 @@ gobble_file (char const *name, enum filetype type, ino_t inode, /* Let the user know via '?' if errno is EACCES, which can happen with Linux kernel 6.12 on an NFS file system. - That's better than a longwinded diagnostic. */ - bool cannot_access_acl = n < 0 && errno == EACCES; + That's better than a longwinded diagnostic. + + Similarly, ignore ENOENT which may happen on some versions + of cygwin when processing dangling symlinks for example. + Also if a file is removed while we're reading ACL info, + ACL_T_UNKNOWN is sufficient indication for that edge case. */ + bool cannot_access_acl = n < 0 + && (errno == EACCES || errno == ENOENT); f->acl_type = (!have_scontext && !have_acl ? (cannot_access_acl ? ACL_T_UNKNOWN : ACL_T_NONE) -- 2.47.3