Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!moncskermit!goanna!yabbie!rcodi From: rcodi@yabbie.rmit.oz (Ian Donaldson) Newsgroups: net.unix-wizards Subject: Re: unix system enhancements Message-ID: <339@yabbie.rmit.oz> Date: Sat, 27-Sep-86 15:36:34 EDT Article-I.D.: yabbie.339 Posted: Sat Sep 27 15:36:34 1986 Date-Received: Wed, 1-Oct-86 01:07:05 EDT References: <4120@brl-smoke.ARPA> Organization: RMIT Comm & Elec Eng, Melbourne, Australia. Lines: 35 In article <4120@brl-smoke.ARPA>, Geoffm@AFSC-HQ.arpa (USAFA) writes: > > 3. And lastly modify the tty driver to support "advising." This would > allow root to watch the characters sent to a terminal and have the > characters that he types inserted into that port's input characte > stream. Under 4.2, you could do this easily by having the user type: script /dev/ttyxx where ttyxx is the tty that you are logged onto. This would enable you to see what the user is doing. Funny things would happen of course if the user jumped into vi, and you had a different terminal type :-) You would have to modify script to do non-buffered writes if the file mentioned was a tty, otherwise you won't see things immediatly when the user types them (script uses fwrite(3) to write to the file, and stdio in all its wisdom doesn't determine optimial buffering for anything other than stdout when it first writes to it). You could say: if(isatty(fileno(fscript))) setbuf(fscript, NULL); or some such, after the fscript = fopen(...) line. As far as you typing input on his tty, it could be done on most versions of 4.2 and some versions of 4.1, but that is currently a security hole, and is best left alone (or even better: fixed) It is without saying that this is something that should be done ONLY with consent of the user. Ian Donaldson