GNU bug report logs - #13635
ls: use different color for unreadable files

Previous Next

Package: coreutils;

Reported by: Joshua Rogers <megamansec <at> gmail.com>

Date: Wed, 6 Feb 2013 07:58:02 UTC

Severity: wishlist

Full log


Message #23 received at 13635 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Joshua Rogers <megamansec <at> gmail.com>
Cc: 13635 <at> debbugs.gnu.org
Subject: Re: bug#13635: Strange ls bug (Combination of -a and --color)
Date: Wed, 06 Feb 2013 15:40:53 -0800
My guess is that 'csf' is readable but not searchable.
That would explain your symptoms:

$ ls -ld csf
dr--------. 2 eggert eggert 4096 Feb  6 15:31 csf
$ ls -ld csf/.
ls: cannot access csf/.: Permission denied
$ ls --color=always -a csf
ls: cannot access csf/.: Permission denied
ls: cannot access csf/..: Permission denied
.  ..

In the last example, 'ls' needs to stat csf/. and csf/..
to see whether their permissions are weird (since directories
with weird permissions are given different colors), but
it cannot do so since csf lacks search permission.

One possible fix would be to alter 'ls' so that, if 'ls' cannot
find out about a file, it gives the file an even weirder
color.  That might be more useful than the current behavior.
Is this something you could write?




This bug report was last modified 6 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.