Hello,
ls calls cap_get_file() from has_capabilty() from print_color_indicator()
on file names ignoring their path, effectively checking wrong (if any) files
for capabilities.
Tested (not) to work on 7.5 and current git version.
Simple test case:
mkdir test test/dir
cd test
touch a dir/a
setcap '=' a
ls --color a dir
Both a's will be colored according to LS_COLORS ca entry. In most use cases
however the bug will lead to files with capabilities not being highlighted.
I believe the proper fix would be to check for capabilities in the same
place where all other stating is done (gobble_file()).
I don't have a patch though, as gobble_file() function is very long (300
lines) and complicated.
Greetings,
Ivan