Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 / ST 1.0; site saber.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!idi!saber!msc From: msc@saber.UUCP (Mark Callow) Newsgroups: net.unix-wizards Subject: Re: Strange behavior of su Message-ID: <1778@saber.UUCP> Date: Tue, 24-Sep-85 13:14:41 EDT Article-I.D.: saber.1778 Posted: Tue Sep 24 13:14:41 1985 Date-Received: Sat, 28-Sep-85 06:48:21 EDT References: <314@aphasia.UUCP> <323@uwvax.UUCP> Distribution: net Organization: Saber Technology, San Jose, CA Lines: 30 > > Every now and then after I have been logged in for a while I will try to > > su, have su ask the password, and then it sits for a bit and exits. It > > You didn't say to whom you were su'ing. However, if you were becoming > root, this behaviour doesn't make sense. If you were becoming another > normal user, this probably means the current directory was inaccesable > to the new user. In this case, su gives up quietly. I think this is > a case there things could be a bit more verbose. It's not su that gives up it's the C shell. Here's the story from the Mt Xinu bug list as reported by Ralph Campbell. _______________________________________________________________________________ csh--bin ralph (Ralph Campbell) 25 May 83 The C shell quits silently if the parent directory (or anything back to the root) isn't readable when it starts up (and if it isn't a login shell). This can happen when you su to someone who can't read your working directory; the su fails silently. Here's why: The Cshell's dinit() calls getwd() (defined in /usr/src/libc/libjobs/getwd.c), which notices the problem, writes an error message to file descriptor 2, and exits. However, file descriptor 2 is closed by initdesc() before getwd() acts. The whole thing is a mess because you're trying to be compatible with version 5 on up with respect to file descriptors, so I daren't suggest a fix. _______________________________________________________________________________ -- From the TARDIS of Mark Callow msc@saber.UUCP, sun!saber!msc@decwrl.ARPA ...{decwrl,ucbvax}!sun!saber!msc, ...{amdcad,ihnp4}!saber!msc Brought to you by Super Global Mega Corp .com