Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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:
Embargoed:

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.