drg (10/12/82)
The su command will fail silently with an exit code of 1 in the following case: a) The user you are su-ing to uses the csh. b) Your current directory is unreachable by him. The problem is in an undocumented routine called getwd() in the -ljobs library, apparently used only by the csh to set the $cwd variable. The getwd() routine will exit with a message on stderr if it can't open one of the directories along your current path. Unfortunately, the csh has already closed stderr before calling getwd(), so the message does not come out. The fix is to replace all exit(1) statements in getwd() by return("/"). This means that the csh will have $cwd wrong, but at least it won't exit mysteriously. Re-build the -ljobs library, and re-compile the csh.