[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ls doesn't detect file capabilities properly

From: Ivan Labath
Subject: ls doesn't detect file capabilities properly
Date: Fri, 6 Nov 2009 21:15:14 +0100
User-agent: Mutt/1.5.13 (2006-08-11)


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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]