From: Pádraig Brady Date: Sun, 30 Mar 2025 14:16:54 +0000 (+0100) Subject: ls: suppress ENOENT errors when reading ACL info X-Git-Tag: v9.7~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d44319fa1cdfaa645465f03bf2ba3ce6cfff098;p=thirdparty%2Fcoreutils.git 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. --- 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)