TIOCSTI (was Terminals are ridiculously insecure)

Root Boy Jim rbj at nav.icst.nbs.gov
Tue Jan 24 03:45:02 AEST 1989


? From: Paul Eggert <eggert at sea.sm.unisys.com>

? 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
	<rbj at nav.icst.nbs.gov> or <uunet!nav.icst.nbs.gov!rbj>
	Crackers and Worms -- Breakfast of Champions!



More information about the Comp.unix.wizards mailing list