The FreeBSD implementation of ls -R decides to omit directories from recursive listing which are omitted from listing anyway. This may be in violation of POSIX [1] but that's irrelevant for this bug report. When ls -R encounters a directory without reading permission, it outputs the resulting EACCES. This even happens for directories which are never listed by ls -R anyway due to their names beginning with a dot, which causes ls to output spurious warnings. To reproduce, in an empty directory do: mkdir .a chmod a-r .a ls -R . The following output results: $ ls -R . ls: ./.a: Permission denied If .a was readable, ls -R would not list it either, so the error message seems wrong. [1]: http://austingroupbugs.net/view.php?id=1023
On 9.3, notice that something similar affects rm(1): $ mkdir aaa; cd aaa; mkdir .bbb; chmod 0077 .bbb $ cd ..; rm -r aaa override ---rwxrwx user/wheel for aaa/.bbb? y rm: aaa/.bbb: Permission denied rm: aaa: Directory not empty I don't know all the rules, but this seems wrong also. The user was a member of group wheel, and all have rwx permissions, and it would seem that they ought to be able to remove the directory; alternatively, perhaps the permissions are hierarchial in nature, and a lower class user can't do what a higher class user can't do. Just thought it may be a worthy comment.