Colorizing file with capabilities has some performance impact (rhbz #467508). 
It should be possible to stop checking for file capabilities by unsetting ca 
attribute of $LS_COLORS. One-line patch solving this issue is attached.

Simple test:
$ strace ls --color 2> tmp && grep -i cap tmp --color

$ eval `dircolors -b | sed s/ca=[^:]*:/ca=:/` # disable checking for file caps
$ strace ls --color 2> tmp && grep -i cap tmp --color


Kamil
From 98db8935f54a930cb75c998e1a7f160b4e9b5cf2 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <[EMAIL PROTECTED]>
Date: Mon, 20 Oct 2008 15:39:07 +0200
Subject: [PATCH] ls: make possible to stop file capabilities checking

* ls.c (print_color_indicator): do not check for file capability if not
colored
---
 src/ls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/ls.c b/src/ls.c
index f454d0e..008aff0 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3976,7 +3976,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;
-- 
1.5.4.1

_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to