Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!rutgers!cmcl2!adm!xadmx!rbj@nav.icst.nbs.gov From: rbj@nav.icst.nbs.gov (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: TIOCSTI (was Terminals are ridiculously insecure) Message-ID: <18176@adm.BRL.MIL> Date: 23 Jan 89 17:45:02 GMT Sender: news@adm.BRL.MIL Lines: 41 ? From: Paul Eggert ? Chris Torek writes: ? >TIOCSTI is a hack. It exists for ONE program (/usr/ucb/mail), ? Oops, I forgot about filename completion in some C shells. I don't see why it is necessary for either. TCSH doesn't use it, and it's completion works just as good or better. However, as we all too soon find out, if something is available, then if must be used, as we find out below: ? GNU Emacs, just before suspending or exiting, ? uses TIOCSTI to put back pre-read characters ? (or anything else the user wants put back). Thanks for the info. I knew about suspending, but exiting is not documented. STI is not a new idea. I remember various hacks to RSX-11M back when people (other than Henry :-) used PDP-11's to do just that. I guess there is a little group that runs around lobbying for and implementing that feature on various operating systems. I agree that its very existence is a security *concern*, but I can see a few uses for it. How many times have users asked the questions: "How can a process change the {environment,working directory} of the parent?" This might be a good thing to do occasionally; one use would be to avoid the cortortions of eval'ing the output of tset. BTW, Chris, as to your idea about stuffing `foobar' in the reverse order before typeahead input: that's the way I always thought it worked until I looked at some code! They documented it right, they just implemented it wrong :-) Why doesn't TIOCSTI do a string rather than just one char? (Root Boy) Jim Cottrell (301) 975-5688 or Crackers and Worms -- Breakfast of Champions!