1

I have recently found a very odd issue I have not encountered before.

╭─daemonslayer2048@desktop ~ 
╰─$ ls -l /tmp/project                            
ls: cannot access '/tmp/SpeedTest/lib': Permission denied
ls: cannot access '/tmp/SpeedTest/First_Boot.py': Permission denied
ls: cannot access '/tmp/SpeedTest/help.sh': Permission denied
ls: cannot access '/tmp/SpeedTest/ResetDefaults.py': Permission denied
ls: cannot access '/tmp/SpeedTest/Manager.py': Permission denied
ls: cannot access '/tmp/SpeedTest/Maintenance.py': Permission denied
total 0
-????????? ? ? ? ?            ? First_Boot.py
-????????? ? ? ? ?            ? help.sh
d????????? ? ? ? ?            ? lib
-????????? ? ? ? ?            ? Maintenance.py
-????????? ? ? ? ?            ? Manager.py
-????????? ? ? ? ?            ? ResetDefaults.py

Is anyone familiar with what may be going on here? Did something get corrupted? I tried searching first but I only seem to get explanations of file permissions nothing to explain how this happened and if I can fix it. I tried setting an owner and permissions to the files but they remain unchanged.

Edit: Added ls -ld of project folder.

╭─daemonslayer204@desktop ~ 
╰─$ ls -ld /tmp/project/
drw-------. 3 daemonslayer204 daemonslayer204 380 Jun 17 15:56 /tmp/project/ 
  • 4
    Please add the directory permissions of `/tmp/project` to the question (`ls -ld /tmp/project`). Looks like the executable bits are not set. – Freddy Jun 18 '20 at 18:55
  • Added the edit you requested. Why did that fix this? Why does the folder need to be executable to be able to ls files in a directory without getting the "?". I am seriosuly lacking some information/understanding apparently. – DaemonSlayer2048 Jun 18 '20 at 19:51
  • 1
    @DaemonSlayer2048 I'm not finding a good reference right now, but the point is that, while having read permissions on a directory lets you read its (d)entries (i.e. list the names of the files inside it), it doesn't allow you to traverse it. Traversing requires "search" permissions (that's `x` (execute) for directories) and is necessary in order to access the inodes of the contained files, which store their metadata (including ownership and permissions). – fra-san Jun 18 '20 at 20:08
  • 2
    Also: [Execute vs Read bit. How do directory permissions in Linux work?](https://unix.stackexchange.com/q/21251/170373) – ilkkachu Jun 18 '20 at 20:15
  • 2
    Also: [Do the parent directory's permissions matter when accessing a subdirectory?](https://unix.stackexchange.com/q/13858/170373) – ilkkachu Jun 18 '20 at 20:16

0 Answers0