Subject: Re: bug#44587: ls prints garbage when listing contents of a directory without exec permissions
From: Paul Eggert <[email-masked]>
To: Jan Schaumann <[email-masked]>
Cc: [email-masked]
Date: Wed, 11 Nov 2020 19:41:08 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 11/11/20 3:24 PM, Jan Schaumann wrote:
> $ ls -la dir
> ls: cannot access dir/.: Permission denied
> ls: cannot access dir/..: Permission denied
> ls: cannot access dir/file: Permission denied
> total 0
> d????????? ? ? ? ?            ? .
> d????????? ? ? ? ?            ? ..
> -????????? ? ? ? ?            ? file
> $
> 
> 
> Expected output:
> 
> $ ls -la dir
> ls: cannot access dir/.: Permission denied
> ls: cannot access dir/..: Permission denied
> ls: cannot access dir/file: Permission denied

As Bernhard mentioned, the actual output is intentional. The expected output 
would be less useful, as it would give the user a bit less information (e.g., it 
would not tell the user where 'file' is a regular file or a directory).