From: Pádraig Brady Date: Tue, 8 Apr 2025 11:11:06 +0000 (+0100) Subject: ls: support capabilities with device 0,0 X-Git-Tag: v9.7~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7007c018de51f972c89f153c128a7a9ce08ac432;p=thirdparty%2Fcoreutils.git ls: support capabilities with device 0,0 * src/ls.c (has_capability_cache): Don't assume a device major,minor of 0,0 never occurs. --- diff --git a/src/ls.c b/src/ls.c index de5a1ae2b9..1078f882f0 100644 --- a/src/ls.c +++ b/src/ls.c @@ -3348,9 +3348,10 @@ has_capability_cache (char const *file, struct fileinfo *f) { /* st_dev of the most recently processed device for which we've found that has_capability fails indicating lack of support. */ + static bool unsupported_cached /* = false */; static dev_t unsupported_device; - if (f->stat_ok && f->stat.st_dev == unsupported_device) + if (f->stat_ok && unsupported_cached && f->stat.st_dev == unsupported_device) { errno = ENOTSUP; return 0; @@ -3358,7 +3359,10 @@ has_capability_cache (char const *file, struct fileinfo *f) bool b = has_capability (file); if (f->stat_ok && !b && !acl_errno_valid (errno)) - unsupported_device = f->stat.st_dev; + { + unsupported_cached = true; + unsupported_device = f->stat.st_dev; + } return b; }