Bug 1326723 - ls displays garbage after permission denied
Summary: ls displays garbage after permission denied
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-13 11:23 UTC by Bill Craig
Modified: 2016-04-13 19:28 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-13 19:28:41 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.