emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44587: closed (ls prints garbage when listing contents of a director


From: GNU bug Tracking System
Subject: bug#44587: closed (ls prints garbage when listing contents of a directory without exec permissions)
Date: Thu, 12 Nov 2020 03:42:02 +0000

Your message dated Wed, 11 Nov 2020 19:41:08 -0800
with message-id <c544f227-6484-447d-0ce3-6a9ad49a3a72@cs.ucla.edu>
and subject line Re: bug#44587: ls prints garbage when listing contents of a 
directory without exec permissions
has caused the debbugs.gnu.org bug report #44587,
regarding ls prints garbage when listing contents of a directory without exec 
permissions
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
44587: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44587
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: ls prints garbage when listing contents of a directory without exec permissions Date: Wed, 11 Nov 2020 18:24:17 -0500 User-agent: Mutt/1.11.1 (2018-12-01)
When running 'ls -l' on a directory that the user does
not have execute permissions on, ls(1) still attempts
to generate the long listing and prints the various
fields with garbage:

$ mkdir dir
$ touch dir/file
$ chmod a-x dir
$ ls -ld dir
drw-r--r-- 2 jschauma users 28 Nov 11 23:15 dir
$ 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
$ 

This is coreutils-8.32.





--- End Message ---
--- Begin Message --- Subject: Re: bug#44587: ls prints garbage when listing contents of a directory without exec permissions Date: Wed, 11 Nov 2020 19:41:08 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
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).


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]