Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!hrc63!miduet!steve From: steve@miduet.mifnet.gec-mi-ate.co.uk (Steve Lademann) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: Bug in 4.2BSD su Message-ID: <141@miduet.mifnet.gec-mi-ate.co.uk> Date: Thu, 24-Apr-86 12:34:54 EDT Article-I.D.: miduet.141 Posted: Thu Apr 24 12:34:54 1986 Date-Received: Sun, 27-Apr-86 06:46:18 EDT Organization: Marconi Instruments Ltd., St.Albans, UK Lines: 34 Xref: watmath net.bugs.4bsd:2074 net.unix-wizards:17828 I posted this once, but I don't think it made it - Try again. >You probably know all about this one, but here goes, anyway. > >There is a bug in VAX 4.2BSD su which occurs if you want to temporarily >change to a different login using the following shell command:- > > su fred > >If the new user doesn't have access to the current directory, su >appears to exit silently without changing to the new user. If the shell >prompts for the new and the old user are similar, it's extremely >difficult to tell what has happened. The reason is that su does not >check that the current directory is accessible prior to exec-ing the >new shell, which, on on being exec-ed and finding that it can't read >the directory, exits ever so quietly with a status of 1. (Or at least, >csh does - I haven't tried sh.) > >The fix is to add a check just prior to shell execing to test >accessibility of the current directory, having juggled the uid and gid >set. If it isn't, the friendly thing to do is to shift to the new >user's home directory. If you're unfriendly, snap his head off and exit. > >If this is of a problem to you, please mail me for a diff. > ----------------------------------------------------------------- |Steve Lademann |Phone: 44 727 59292 x326 | |Marconi Instruments Ltd|UUCP : ...mcvax!ukc!hrc63!miduet!steve | |St. Albans |NRS : steve@uk.co.gec-mi-ate.mifnet | |Herts. UK | | ----------------------------------------------------------------- |"The views expressed herein do not necessarily reflect"| | |"those of my employer, and may not even reflect my own"| | -----------------------------------------------------------------