I noticed that when a user is working in a directory to which he does not have read permission that using cd produces different error messages, depending on whether or not a subdirectory exists:
$ ls ls: cannot open directory .: Permission denied $ cd nonexistentdirectory -bash: cd: nonexistentdirectory: No such file or directory $ cd existingdirectory -bash: cd: username: Permission denied
It raises the question: Is the fact that a user can brute-force a directory listing this way without read permission a security flaw? If so, is it a flaw of UNIX or Bash?