exa icon indicating copy to clipboard operation
exa copied to clipboard

Permission denied when exa reads contents of directory that doesn't have execute permission.

Open kazuki-hanai opened this issue 2 years ago • 0 comments

Problem

exa returns permission denied when exa read contents of directory that doesn't have execute permission. GNU ls returns mode bits with question mark in the same case. Is it better to show blank mode bits in exa?

How it repoduce?

In exa

$ mkdir -m a=rwx d1
$ echo "hello" > d1/test
$ exa -la d1
.rw-rw-r-- 6 user 31 Jul 20:08 test
$ chmod a-x d1
$ exa -ld d1
drw-rw-rw- - user 31 Jul 20:08 d1
$ exa -la d1
[d1/test: Permission denied (os error 13)]

In GNU ls

$ mkdir -m a=rwx d1
$ echo "hello" > d1/test
$ ls -la d1
total 12
drwxrwxrwx 2 user user 4096 Jul 31 20:08 .
drwxrwxr-x 3 user user 4096 Jul 31 20:07 ..
-rw-rw-r-- 1 user user    6 Jul 31 20:08 test
$ chmod a-x d1
$ ls -ld d1
drw-rw-rw- 2 user user 4096 Jul 31 20:08 d1
$  ls -la d1
ls: cannot access 'd1/..': Permission denied
ls: cannot access 'd1/test': Permission denied
ls: cannot access 'd1/.': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
-????????? ? ? ? ?            ? test

version

$ exa --version
v0.10.1 [+git]

OS

Ubuntu 20.04.4 LTS

kazuki-hanai avatar Jul 31 '22 11:07 kazuki-hanai