pty - run a program under a pty session

pty is meant as the sole interface between pseudo-terminals and the rest
of the system. Some features: improved security; over fifty options for
precise control; session disconnecting and reconnecting; full efficiency
after a reconnect; a gradual upgrade path so that all your old utilities
will work without change; support for applications that need full pty
control; and a reasonably smart install script. Also in this package are
twenty-one utilities, including a ``script'' that actually works.

pty has been thoroughly tested on several BSD 4.3-based machines and
tested on several BSD 4.2-based machines. It should be easy to port to
any system supporting pseudo-terminals and UNIX-domain sockets. If you
know any application of ptys that this program can't handle, or if you
have a different machine that would benefit from the modularity and
power of a pty port, please let the author know.


pty does not work under POSIX-based machines (such as SunOS 4.1), even
when it works perfectly under their predecessors (such as SunOS 4.0.3).
The main problem is POSIX's introduction of sessions and the way it
kills a non-orphaned process in an orphaned process group. There are
other incompatibilities, mostly minor but some (like accounting and
setuid problems) important. The author is working on a POSIX port.


pty version 3.001, August 21, 1990.
Copyright (c) 1990, Daniel J. Bernstein.
All rights reserved.

This distribution packaged August 22, 1990.

General layout:
CHANGES         Description of changes since first distributed version
COPYRIGHT       A comprehensible copyright notice
FILES           File list (used by make shar)
INSTALL         A script to guide you through compilation and installation
INSTALLREADABLE INSTALL's information, in a format you can reasonably edit
MANIFEST        Shipping list
QUESTIONS       Some questions that pty answers
README          This document
TESTS           A script to guide you through some tests
Makefile        Installation commands
*.c             Programs
*.h             Header files
pty.man         Documentation
patch/*         Patches to other programs to better use pty
util/*          Utilities

Before you do anything else, run the INSTALL script. It'll guide you
through compiling and installing pty and the utilities. Then run TESTS
to exercise a few of pty's features on your system. patch/ is separate;
read patch/README at your leisure.

Read CHANGES for a list of changes. pty -C and pty -W give copyright and
warranty information; pty -H prints a help screen.

Note that INSTALL, util/lock.c, util/script.tidy, util/write.c, and
util/wall.c all contain control characters.


Known problems:

POSIX compatibility---might as well do complete rewrite
last was removed but is mentioned in INSTALL and INSTALLREADABLE
INSTALL's usleep test is not accurate in Ultrix 3.1C (aargh)
childsig = SIGCONT for TSTP in master.c?
PIPE should be handled by finish in sigler.c for NO_FDPASSING folks
sesslist gives error for a session directory not yet created
pty -H lists /etc/wtmp---guaranteed to confuse some people
QUESTIONS and TESTS list sed ... | more, race; more should be grep x
on cannot chdir to session directory, pty does not restore correctly
  (set up your session directory correctly!)


TODO list:

INSTALLSU script, for the final stages of installation
fix PTYDIR propagation into utilities
vhangup()? this is a sticky issue. probably not but we'll see
locking on /etc/utmp and /usr/adm/wtmp? not necessary if APPEND works
generally handle signals better in sigler
clean up ``last'' and include it in package
``detach''? not yet, for reasons discussed in paper
must pty really stop on pty -T ... &?
``utmpinit'', so that pty and login will get along---generally useful


More comprehensive discussion will be available soon in ``The Design,
Implementation, and Use of a Pseudo-Terminal Manager.''
