Watch, Spy, whatever you wanna call it

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Sep 21 13:13:02 AEST 1990


In article <29835 at netnews.upenn.edu> kehoe at scotty.dccs.upenn.edu (Brendan Kehoe) writes:
> Well, anyway, what's the deal? Has one ever been written for under Unix? (With
> the plethora of hackers [old definition, not vernacular] that have and are in
> the Unix world today, I'd be really surprised if it hadn't.)

It's pretty easy to do with my pty program. (What isn't? :-) )

A user runs his session through the following script, sessplex, rather
than the usual sess:

  #!/bin/sh
  ( umask 077; touch /tmp/sessin.$$; touch /tmp/sessout.$$ )
  ( tail -f /tmp/sessin.$$ &; cat -u ) \
  | sess "$@"
  | tee /tmp/sessout.$$
  rm /tmp/sessin.$$ /tmp/sessout.$$

Now anything written to /tmp/sessin.$$ will be used as input to the
session. The sysadmin can join a session by typing (e.g.)

  % tail -f /tmp/sessout.19432 &; stty -echo; cat -u > /tmp/sessin.19432

Of course, this assumes user cooperation. UNIX provides so many ways to
communicate with the rest of the world that a user can probably find
*some* way to execute commands unobserved if he wants. On the other
hand, the admin of a pty-based system can easily make sessplex the
default.

Note that pty is only for BSD variants at the moment.

---Dan



More information about the Comp.unix.internals mailing list