Re: x bit for dirs: misfeature?

From: Thomas Hood (jdthood@mail.com)
Date: Tue Nov 20 2001 - 11:05:04 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:23 EST