Bug 1326723

Summary: ls displays garbage after permission denied
Product: Red Hat Enterprise Linux 7 Reporter: Bill Craig <billcraigedg>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-13 19:28:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bill Craig 2016-04-13 11:23:12 UTC
Description of problem:
when ls -l on directory has permission denied on files the output is followed by some garbage lines.

Version-Release number of selected component (if applicable):
edplinux:mdl24:/tmp$ /bin/ls --version | head -1
ls (GNU coreutils) 8.22
edplinux:mdl24:/tmp$ rpm -q coreutils
coreutils-8.22-15.el7_2.1.x86_64

How reproducible:
Very

Steps to Reproduce:
edplinux:mdl24:/tmp$ mkdir test
edplinux:mdl24:/tmp$ > test/a
edplinux:mdl24:/tmp$ > test/b
edplinux:mdl24:/tmp$ /bin/ls -dl test
drwxrwxr-x. 2 mdl24 users 22 Apr 13 11:24 test
edplinux:mdl24:/tmp$ /bin/ls -l test
total 0
-rw-rw-r--. 1 mdl24 users 0 Apr 13 11:24 a
-rw-rw-r--. 1 mdl24 users 0 Apr 13 11:24 b
edplinux:mdl24:/tmp$ chmod 666 test
edplinux:mdl24:/tmp$ /bin/ls -l test
/bin/ls: cannot access test/a: Permission denied
/bin/ls: cannot access test/b: Permission denied
total 0
?????????? ? ? ? ?            ? a
?????????? ? ? ? ?            ? b


Actual results:


Expected results:


Additional info:

Comment 2 Ondrej Vasik 2016-04-13 19:28:41 UTC
It is not garbage. Utility ls uses question mark in more places - one of them is situation when stat systemcall fails due to permissions. This behaviour is expected and it is not a bug in coreutils package and is documented in coreutils info documentation.