Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site hammer.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!orca!hammer!dce From: dce@hammer.UUCP (David Elliott) Newsgroups: net.unix-wizards Subject: Re: unix quirks (chmod 000 dir) Message-ID: <1181@hammer.UUCP> Date: Mon, 22-Apr-85 09:55:51 EST Article-I.D.: hammer.1181 Posted: Mon Apr 22 09:55:51 1985 Date-Received: Wed, 24-Apr-85 03:06:38 EST References: <9938@brl-tgr.ARPA> <1135@amdcad.UUCP> Reply-To: dce@hammer.UUCP (David Elliott) Organization: Tektronix, Wilsonville OR Lines: 32 Summary: In article <9938@brl-tgr.ARPA> argv@ucb-vax.ARPA writes: > > >>% mkdir foo > >>% chmod 000 foo > >>% cd foo > >>foo: no such file or directory >You don't seem to understand: it shouldn't say: "no such file or directory", >it should say: "Permission denied." The example, was just that, an example. >This "bug" appears all the time whenever the permission is denied, it comes >up with the wrong error message! Try to cd into a path that you never had >any problems with and it says that it doesn't even EXIST. Then you panic and >call the system administrator and request a back up recovery and spend a >lot of time and effort (sometimes even money) to get a directory replaced >that never even went away. I just want the correct error message. Is this >clear now? The problem is the fact that the csh cd command is running through the cdpath vector, attempting to do a chdir() each time. When the error message is finally printed, it is done using the last value of errno (in this case, ENOENT). Thus, you get "no such file or directory". Possible fixes: 1. Change the cd code to print an error message for each attempt that does not result in errno being ENOENT. 2. Change the cd code to save errno if it isn't ENOENT, and use this saved value (default ENOENT) to print the message. David Elliott tektronix!tekecs!dce