What permissions for /dev/pty?? and /dev/tty??

Jamie Lokier (jamie@rebellion.co.uk)
Sat, 1 Jun 96 04:25 BST


Hello all,

What permissions should I have on /dev/pty?? and /dev/tty?? ?

MAKEDEV-C-2.2 has /dev/pty?? owned by root.root with permission 666, and
/dev/tty?? owned by root.tty with permission 620. I know why this makes
sense with login, xterm, etc., but it prevents non-setuid user processes
(like Emacs) from opening a pty/tty pair.

To solve this, I give /dev/tty?? permissions 666, but this completely
wrecks tty security. Is there a clean solution? Perhaps there is a
need for /proc/tty/tty?? or similar, which are automatically created and
inherit ownership when /dev/pty?? are opened.

Cheers,
-- Jamie