Re: x bit for dirs: misfeature?

Thomas Hood
2001-11-20T16:04:45Z

Please forgive me if I overlooked the message that
already said this, but ...

James Sutherland wrote that "There are valid uses for
X only directories (i.e. users are not allowed to list
the contents, only to access them directly by name).
R-only directories make little sense". Then there
followed a long discussion about the utility of "--x"
directories. (I agree that they aren't a very good
idea, since an explorable directory can be "listed" by
trial and error on the filenames within it.)

However, a decent reason for having separate r and x
is that "r--" directories _do_ make sense. When a
directory is "r--", its contents can be _listed_ but the
directory cannot be browsed. Observe: // Thomas Hood

jdthood@thanatos:~/tmp$ ls -l
total 8
drwxr-xr-x 2 jdthood jdthood 4096 Nov 20 10:59 ./
drwx------ 89 jdthood jdthood 4096 Nov 20 10:55 ../
jdthood@thanatos:~/tmp$ mkdir --mode=777 test
jdthood@thanatos:~/tmp$ ls -l
total 12
drwxr-xr-x 3 jdthood jdthood 4096 Nov 20 10:59 ./
drwx------ 89 jdthood jdthood 4096 Nov 20 10:55 ../
drwxrwxrwx 2 jdthood jdthood 4096 Nov 20 10:59 test/
jdthood@thanatos:~/tmp$ touch test/1
jdthood@thanatos:~/tmp$ touch test/2
jdthood@thanatos:~/tmp$ ls -l . test
.:
total 12
drwxr-xr-x 3 jdthood jdthood 4096 Nov 20 10:59 ./
drwx------ 89 jdthood jdthood 4096 Nov 20 10:55 ../
drwxrwxrwx 2 jdthood jdthood 4096 Nov 20 10:59 test/

test:
total 8
drwxrwxrwx 2 jdthood jdthood 4096 Nov 20 10:59 ./
drwxr-xr-x 3 jdthood jdthood 4096 Nov 20 10:59 ../
-rw-r--r-- 1 jdthood jdthood 0 Nov 20 10:59 1
-rw-r--r-- 1 jdthood jdthood 0 Nov 20 10:59 2
jdthood@thanatos:~/tmp$ chmod ugo-x test
jdthood@thanatos:~/tmp$ ls -l . test
.:
total 12
drwxr-xr-x 3 jdthood jdthood 4096 Nov 20 10:59 ./
drwx------ 89 jdthood jdthood 4096 Nov 20 10:55 ../
drw-rw-rw- 2 jdthood jdthood 4096 Nov 20 10:59 test/

ls: test/.: Permission denied
ls: test/..: Permission denied
ls: test/1: Permission denied
ls: test/2: Permission denied
test:
total 0
jdthood@thanatos:~/tmp$ chmod ugo-r test
jdthood@thanatos:~/tmp$ ls -l . test
.:
total 12
drwxr-xr-x 3 jdthood jdthood 4096 Nov 20 10:59 ./
drwx------ 89 jdthood jdthood 4096 Nov 20 10:55 ../
d-w--w--w- 2 jdthood jdthood 4096 Nov 20 10:59 test/

ls: test: Permission denied