summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2008-10-20 15:39:07 +0200
committerJim Meyering <meyering@redhat.com>2008-10-21 11:13:01 +0200
commitf3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9 (patch)
tree254aa4f6efeaa1a49fe2b5d7c51806d166d1182d /src
parent08c38ab7cbc0c6f3721885256ae3634f1e76f174 (diff)
downloadcoreutils-f3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9.tar.xz
ls: make it possible to disable file capabilities checking
* ls.c (print_color_indicator): Do not check for file capability if that attribute is not being colored. Since 84f6abfe00b4ab533145623638b417a2221f9c75, ls --color would check each file for "capabilities". In <http://bugzilla.redhat.com/467508>, James Antill reported that ls --color seemed slower with capabilities detection.
Diffstat (limited to 'src')
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 739057cf7..30217683e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3975,7 +3975,7 @@ print_color_indicator (const char *name, mode_t mode, int linkok,
type = C_SETUID;
else if ((mode & S_ISGID) != 0)
type = C_SETGID;
- else if (has_capability (name))
+ else if (is_colored (C_CAP) && has_capability (name))
type = C_CAP;
else if ((mode & S_IXUGO) != 0)
type = C_EXEC;