uutils / coreutils

Cross-platform Rust rewrite of the GNU coreutils
https://uutils.github.io/
MIT License
17.26k stars 1.24k forks source link

ls: gnu test case `capability` compatibility #6540

Open matrixhead opened 4 days ago

matrixhead commented 4 days ago

This issue is for the Gnu test case capability.sh for util. This test case is used to check whether ls correctly colors the files with the Linux capabilities with ca color indicator.

Example

touch file1 file2
sudo setcap 'cap_net_bind_service=ep' file1
LS_COLORS="ca=30;41" ls --color=always

should produce output like this

^[[0m^[[30;41mfile1^[[0m     <-------------- correctly colors file with the capabilities set
file2

but uu_ls produce output like this

file1     <-------------- no color for the same file
file2

This test also checks that, whether the ex indicator is given or not, the ca indicator should be used to color the file with the capabilities.