minix/minix/commands
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
..
add_route remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
arp remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
at New sources layout 2014-07-31 16:00:30 +02:00
atnormalize Import a few manpages 2014-11-25 11:04:20 +01:00
autopart commands/autopart: Fix dead code block 2015-03-13 18:53:05 +01:00
backup New sources layout 2014-07-31 16:00:30 +02:00
btrace New sources layout 2014-07-31 16:00:30 +02:00
cawf cawf: Update K&R function declarations 2015-05-18 15:20:39 +02:00
cdprobe New sources layout 2014-07-31 16:00:30 +02:00
ci New sources layout 2014-07-31 16:00:30 +02:00
cleantmp New sources layout 2014-07-31 16:00:30 +02:00
cmp New sources layout 2014-07-31 16:00:30 +02:00
co New sources layout 2014-07-31 16:00:30 +02:00
compress New sources layout 2014-07-31 16:00:30 +02:00
crc New sources layout 2014-07-31 16:00:30 +02:00
cron New sources layout 2014-07-31 16:00:30 +02:00
crontab New sources layout 2014-07-31 16:00:30 +02:00
decomp16 Import a few manpages 2014-11-25 11:04:20 +01:00
DESCRIBE Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
devmand devmand: properly prevent overflow 2015-04-15 08:28:59 +02:00
devsize Import a few manpages 2014-11-25 11:04:20 +01:00
dhcpd dhcpd: don't crash so easily 2014-11-17 20:17:43 +00:00
dhrystone New sources layout 2014-07-31 16:00:30 +02:00
diff New sources layout 2014-07-31 16:00:30 +02:00
diskctl New sources layout 2014-07-31 16:00:30 +02:00
dosread New sources layout 2014-07-31 16:00:30 +02:00
eject New sources layout 2014-07-31 16:00:30 +02:00
fbdctl New sources layout 2014-07-31 16:00:30 +02:00
fdisk New sources layout 2014-07-31 16:00:30 +02:00
fetch New sources layout 2014-07-31 16:00:30 +02:00
find New sources layout 2014-07-31 16:00:30 +02:00
fix commands/fix: create manpage for fix(8) 2015-03-24 08:21:14 +01:00
format New sources layout 2014-07-31 16:00:30 +02:00
fsck.mfs MFS: use libfsdriver 2014-09-18 12:46:27 +00:00
gcov-pull New sources layout 2014-07-31 16:00:30 +02:00
host New sources layout 2014-07-31 16:00:30 +02:00
hostaddr remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
ifconfig New sources layout 2014-07-31 16:00:30 +02:00
ifdef New sources layout 2014-07-31 16:00:30 +02:00
intr New sources layout 2014-07-31 16:00:30 +02:00
ipcrm New sources layout 2014-07-31 16:00:30 +02:00
ipcs New sources layout 2014-07-31 16:00:30 +02:00
irdpd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
isoread New sources layout 2014-07-31 16:00:30 +02:00
loadfont New sources layout 2014-07-31 16:00:30 +02:00
loadkeys New sources layout 2014-07-31 16:00:30 +02:00
loadramdisk New sources layout 2014-07-31 16:00:30 +02:00
logger New sources layout 2014-07-31 16:00:30 +02:00
look New sources layout 2014-07-31 16:00:30 +02:00
lp New sources layout 2014-07-31 16:00:30 +02:00
lpd New sources layout 2014-07-31 16:00:30 +02:00
lspci New sources layout 2014-07-31 16:00:30 +02:00
mail New sources layout 2014-07-31 16:00:30 +02:00
MAKEDEV Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
mount New sources layout 2014-07-31 16:00:30 +02:00
mt New sources layout 2014-07-31 16:00:30 +02:00
netconf dp8390: update, allow default port and IRQ 2014-12-04 12:10:46 +00:00
nonamed remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
part New sources layout 2014-07-31 16:00:30 +02:00
partition New sources layout 2014-07-31 16:00:30 +02:00
pkgin_all New sources layout 2014-07-31 16:00:30 +02:00
pkgin_cd New sources layout 2014-07-31 16:00:30 +02:00
pkgin_sets pkgin_sets: Fix python package name 2014-09-12 11:10:30 +02:00
playwave New sources layout 2014-07-31 16:00:30 +02:00
postinstall New sources layout 2014-07-31 16:00:30 +02:00
pr_routes remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
prep New sources layout 2014-07-31 16:00:30 +02:00
printroot New sources layout 2014-07-31 16:00:30 +02:00
profile Remove support for call profiling 2014-09-30 12:39:03 +00:00
progressbar New sources layout 2014-07-31 16:00:30 +02:00
ps ps: fix reported run time 2014-08-24 09:22:36 +00:00
pwdauth New sources layout 2014-07-31 16:00:30 +02:00
ramdisk New sources layout 2014-07-31 16:00:30 +02:00
rarpd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
rawspeed Import a few manpages 2014-11-25 11:04:20 +01:00
rcp remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
readclock New sources layout 2014-07-31 16:00:30 +02:00
recwave Get rid of K&R functions in recwave 2015-03-18 08:21:31 +01:00
remsync New sources layout 2014-07-31 16:00:30 +02:00
repartition New sources layout 2014-07-31 16:00:30 +02:00
rget remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
rlogin remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
rotate Make rotate manpage more detailed 2015-03-23 11:06:37 +01:00
rsh remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
rshd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
screendump New sources layout 2014-07-31 16:00:30 +02:00
service New sources layout 2014-07-31 16:00:30 +02:00
setup Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
slip New sources layout 2014-07-31 16:00:30 +02:00
spell New sources layout 2014-07-31 16:00:30 +02:00
sprofalyze sprofalyze: Fix minor typo 2015-05-18 13:54:19 +02:00
sprofdiff Add manpage for sprofdiff 2015-05-18 13:52:13 +02:00
srccrc New sources layout 2014-07-31 16:00:30 +02:00
svclog New sources layout 2014-07-31 16:00:30 +02:00
svrctl svrctl(2) update 2014-09-29 16:15:21 +00:00
swifi swifi: Fix incorrect memset 2015-03-23 14:56:59 +01:00
synctree New sources layout 2014-07-31 16:00:30 +02:00
sysenv New sources layout 2014-07-31 16:00:30 +02:00
syslogd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
tcpd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
tcpdp remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
tcpstat svrctl(2) update 2014-09-29 16:15:21 +00:00
telnet remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
telnetd remove libcompat_minix as library 2014-08-28 18:49:13 +02:00
term New sources layout 2014-07-31 16:00:30 +02:00
termcap New sources layout 2014-07-31 16:00:30 +02:00
tget New sources layout 2014-07-31 16:00:30 +02:00
time New sources layout 2014-07-31 16:00:30 +02:00
truncate New sources layout 2014-07-31 16:00:30 +02:00
udpstat svrctl(2) update 2014-09-29 16:15:21 +00:00
umount New sources layout 2014-07-31 16:00:30 +02:00
update New sources layout 2014-07-31 16:00:30 +02:00
update_bootcfg Import a few manpages 2014-11-25 11:04:20 +01:00
updateboot Import a few manpages 2014-11-25 11:04:20 +01:00
version New sources layout 2014-07-31 16:00:30 +02:00
vol New sources layout 2014-07-31 16:00:30 +02:00
worldstone New sources layout 2014-07-31 16:00:30 +02:00
writeisofs writeisofs: set file struct version field to one 2014-09-18 12:46:29 +00:00
zdump New sources layout 2014-07-31 16:00:30 +02:00
zmodem New sources layout 2014-07-31 16:00:30 +02:00
Makefile Importing bin/dd 2015-04-15 13:50:57 +02:00
Makefile.inc merge libminlib with libc 2014-08-28 18:49:19 +02:00