From: Kamil Dudka Date: Mon, 20 Oct 2008 13:39:07 +0000 (+0200) Subject: ls: make it possible to disable file capabilities checking X-Git-Tag: v7.1~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3f1ccfd;p=thirdparty%2Fcoreutils.git 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 , James Antill reported that ls --color seemed slower with capabilities detection. --- diff --git a/src/ls.c b/src/ls.c index 739057cf73..30217683e8 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;