minix/minix/include/minix
David van Moolenbroek da21d85025 Add PTYFS, Unix98 pseudo terminal support
This patch adds support for Unix98 pseudo terminals, that is,
posix_openpt(3), grantpt(3), unlockpt(3), /dev/ptmx, and /dev/pts/.
The latter is implemented with a new pseudo file system, PTYFS.

In effect, this patch adds secure support for unprivileged pseudo
terminal allocation, allowing programs such as tmux(1) to be used by
non-root users as well.  Test77 has been extended with new tests, and
no longer needs to run as root.

The new functionality is optional.  To revert to the old behavior,
remove the "ptyfs" entry from /etc/fstab.

Technical nodes:

o The reason for not implementing the NetBSD /dev/ptm approach is that
  implementing the corresponding ioctl (TIOCPTMGET) would require
  adding a number of extremely hairy exceptions to VFS, including the
  PTY driver having to create new file descriptors for its own device
  nodes.

o PTYFS is required for Unix98 PTYs in order to avoid that the PTY
  driver has to be aware of old-style PTY naming schemes and even has
  to call chmod(2) on a disk-backed file system.  PTY cannot be its
  own PTYFS since a character driver may currently not also be a file
  system.  However, PTYFS may be subsumed into a DEVFS in the future.

o The Unix98 PTY behavior differs somewhat from NetBSD's, in that
  slave nodes are created on ptyfs only upon the first call to
  grantpt(3).  This approach obviates the need to revoke access as
  part of the grantpt(3) call.

o Shutting down PTY may leave slave nodes on PTYFS, but once PTY is
  restarted, these leftover slave nodes will be removed before they
  create a security risk.  Unmounting PTYFS will make existing PTY
  slaves permanently unavailable, and absence of PTYFS will block
  allocation of new Unix98 PTYs until PTYFS is (re)mounted.

Change-Id: I822b43ba32707c8815fd0f7d5bb7a438f51421c1
2015-06-23 17:43:46 +00:00
..
acpi.h New sources layout 2014-07-31 16:00:30 +02:00
audio_fw.h minix libraries: resolve clang warnings 2014-09-30 21:04:09 +00:00
bdev.h IOCTL requests are unsigned longs now 2014-09-29 15:11:01 +00:00
bitmap.h New sources layout 2014-07-31 16:00:30 +02:00
blockdriver.h New sources layout 2014-07-31 16:00:30 +02:00
blockdriver_mt.h minix libraries: resolve clang warnings 2014-09-30 21:04:09 +00:00
board.h New sources layout 2014-07-31 16:00:30 +02:00
btrace.h New sources layout 2014-07-31 16:00:30 +02:00
callnr.h Remove support for call profiling 2014-09-30 12:39:03 +00:00
chardriver.h New sources layout 2014-07-31 16:00:30 +02:00
clkconf.h minix libraries: resolve clang warnings 2014-09-30 21:04:09 +00:00
com.h Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
config.h Remove support for call profiling 2014-09-30 12:39:03 +00:00
const.h New sources layout 2014-07-31 16:00:30 +02:00
cpufeature.h New sources layout 2014-07-31 16:00:30 +02:00
debug.h New sources layout 2014-07-31 16:00:30 +02:00
devio.h New sources layout 2014-07-31 16:00:30 +02:00
devman.h New sources layout 2014-07-31 16:00:30 +02:00
dmap.h Turn PCI into a character driver 2014-11-10 14:43:27 +01:00
driver.h New sources layout 2014-07-31 16:00:30 +02:00
drivers.h New sources layout 2014-07-31 16:00:30 +02:00
drvlib.h New sources layout 2014-07-31 16:00:30 +02:00
ds.h New sources layout 2014-07-31 16:00:30 +02:00
endpoint.h New sources layout 2014-07-31 16:00:30 +02:00
fb.h New sources layout 2014-07-31 16:00:30 +02:00
fsdriver.h Add libfsdriver: a library to drive file systems 2014-09-18 12:46:23 +00:00
fslib.h New sources layout 2014-07-31 16:00:30 +02:00
gcov.h New sources layout 2014-07-31 16:00:30 +02:00
gpio.h New sources layout 2014-07-31 16:00:30 +02:00
hash.h New sources layout 2014-07-31 16:00:30 +02:00
hgfs.h New sources layout 2014-07-31 16:00:30 +02:00
i2c.h New sources layout 2014-07-31 16:00:30 +02:00
i2cdriver.h New sources layout 2014-07-31 16:00:30 +02:00
input.h New sources layout 2014-07-31 16:00:30 +02:00
inputdriver.h New sources layout 2014-07-31 16:00:30 +02:00
ioctl.h New sources layout 2014-07-31 16:00:30 +02:00
ipc.h Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
ipcconst.h New sources layout 2014-07-31 16:00:30 +02:00
keymap.h New sources layout 2014-07-31 16:00:30 +02:00
libminixfs.h Clean up obsolete FS support routines 2014-09-18 13:01:02 +00:00
log.h New sources layout 2014-07-31 16:00:30 +02:00
Makefile Add libfsdriver: a library to drive file systems 2014-09-18 12:46:23 +00:00
minlib.h libc: resolve minix clang warnings 2014-09-30 20:35:56 +00:00
mmio.h New sources layout 2014-07-31 16:00:30 +02:00
mthread.h New sources layout 2014-07-31 16:00:30 +02:00
netdriver.h libnetdriver: turn into network driver framework 2014-12-04 12:10:48 +00:00
netsock.h New sources layout 2014-07-31 16:00:30 +02:00
optset.h New sources layout 2014-07-31 16:00:30 +02:00
padconf.h New sources layout 2014-07-31 16:00:30 +02:00
param.h New sources layout 2014-07-31 16:00:30 +02:00
partition.h New sources layout 2014-07-31 16:00:30 +02:00
paths.h Move all services to /service 2014-07-31 16:00:31 +02:00
portio.h New sources layout 2014-07-31 16:00:30 +02:00
priv.h New sources layout 2014-07-31 16:00:30 +02:00
procfs.h New sources layout 2014-07-31 16:00:30 +02:00
profile.h Remove support for call profiling 2014-09-30 12:39:03 +00:00
queryparam.h New sources layout 2014-07-31 16:00:30 +02:00
rs.h PFS, inet: use static UID to drop privileges 2015-06-06 21:42:48 +00:00
safecopies.h New sources layout 2014-07-31 16:00:30 +02:00
sched.h New sources layout 2014-07-31 16:00:30 +02:00
sef.h libsys: resolve clang warnings 2014-09-30 20:08:54 +00:00
sffs.h libsffs: make path names constant 2014-09-30 12:48:10 +00:00
sound.h New sources layout 2014-07-31 16:00:30 +02:00
spin.h New sources layout 2014-07-31 16:00:30 +02:00
sys_config.h New sources layout 2014-07-31 16:00:30 +02:00
sysinfo.h New sources layout 2014-07-31 16:00:30 +02:00
syslib.h Remove support for call profiling 2014-09-30 12:39:03 +00:00
sysutil.h Move clock_time into libsys 2014-09-18 12:46:26 +00:00
timers.h New sources layout 2014-07-31 16:00:30 +02:00
type.h New sources layout 2014-07-31 16:00:30 +02:00
u64.h New sources layout 2014-07-31 16:00:30 +02:00
usb.h Much USB code for ARM USB support 2014-08-29 18:52:49 +02:00
usb_ch9.h New sources layout 2014-07-31 16:00:30 +02:00
vbox.h libsffs: make path names constant 2014-09-30 12:48:10 +00:00
vboxfs.h New sources layout 2014-07-31 16:00:30 +02:00
vboxif.h New sources layout 2014-07-31 16:00:30 +02:00
vboxtype.h New sources layout 2014-07-31 16:00:30 +02:00
vfsif.h New sources layout 2014-07-31 16:00:30 +02:00
virtio.h libvirtio: expose result size on packet dequeue 2014-12-04 12:10:47 +00:00
vm.h libfsdriver: support mmap on FSes with no device 2014-11-15 11:19:52 +00:00
vtreefs.h libvtreefs: API changes/extensions, part 2 2014-11-12 12:13:43 +00:00