ls: reinstate capability checking in more cases
commit647a8b8cf9184b12e15cca3b62b8647d8d8447e0
authorPádraig Brady <P@draigBrady.com>
Wed, 2 Oct 2024 21:57:16 +0000 (2 22:57 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 2 Oct 2024 22:17:48 +0000 (2 23:17 +0100)
tree8b686f946986b41909bdc5ccb1bb7e4fbaef70b5
parent2606f5a0437e092078167afbcd1dabb1b00ecb88
ls: reinstate capability checking in more cases

The recent commit v9.5-119-g4ce432ad8 restricted capability checking
to only files with XATTR_NAME_CAPS set.  If this is done then we need
to adjust tests/ls/no-cap.sh so that it doesn't always skip.  More
problematically XATTR_NAME_CAPS was only determined in long listing
mode, thus breaking capability coloring in short listing mode
as evidenced by the failing tests/ls/capability.sh test.

Note capability checking does have a large overhead, but we've
disabled capability checking by default anyway through the default
color configuration since v9.0-187-g6b5134770

So for these reasons revert to checking capabilities as before.

* src/ls.c (gobble_file): Check for capabilities in all modes
if enabled in color config.
src/ls.c