freebsd-nq/sys/fs
Poul-Henning Kamp 9c71cb4bef Even if the permissions deny it, a process should be allowed to
access its controlling terminal.

In essense, history dictates that any process is allowed to open
/dev/tty for RW, irrespective of credential, because by definition
it is it's own controlling terminal.

Before DEVFS we relied on a hacky half-device thing (kern/tty_tty.c)
which did the magic deep down at device level, which at best was
disgusting from an architectural point of view.

My first shot at this was to use the cloning mechanism to simply
give people the right tty when they ask for /dev/tty, that's why
you get this, slightly counter intuitive result:

        syv# ls -l /dev/tty `tty`
        crw--w----  1 u1  tty    5,   0 Jan 13 22:14 /dev/tty
        crw--w----  1 u1  tty    5,   0 Jan 13 22:14 /dev/ttyp0

Trouble is, when user u1 su(1)'s to user u2, he cannot open
/dev/ttyp0 anymore because he doesn't have permission to do so.

The above fix allows him to do that.

The interesting side effect is that one was previously only able
to access the controlling tty by indirection:
        date > /dev/tty
but not by name:
        date > `tty`

This is now possible, and that feels a lot more like DTRT.

PR:             46635
MFC candidate:  could be.
2003-01-13 22:20:36 +00:00
..
cd9660 Temporarily introduce a new VOP_SPECSTRATEGY operation while I try 2003-01-04 22:10:36 +00:00
coda Back our kernel support for reliable signal queues. 2002-10-01 17:15:53 +00:00
deadfs Fix comments and one resulting code confusion about the type of the 2002-10-16 08:04:11 +00:00
devfs Even if the permissions deny it, a process should be allowed to 2003-01-13 22:20:36 +00:00
fdescfs Bow to the whining masses and change a union back into void *. Retain 2003-01-13 00:33:17 +00:00
fifofs Bow to the whining masses and change a union back into void *. Retain 2003-01-13 00:33:17 +00:00
hpfs Temporarily introduce a new VOP_SPECSTRATEGY operation while I try 2003-01-04 22:10:36 +00:00
msdosfs Temporarily introduce a new VOP_SPECSTRATEGY operation while I try 2003-01-04 22:10:36 +00:00
ntfs Since Jeffr made the std* functions the default in rev 1.63 of 2003-01-04 08:47:19 +00:00
nullfs Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/ 2002-12-30 21:18:15 +00:00
nwfs Since Jeffr made the std* functions the default in rev 1.63 of 2003-01-04 08:47:19 +00:00
portalfs Bow to the whining masses and change a union back into void *. Retain 2003-01-13 00:33:17 +00:00
procfs Slightly change the semantics of vnode labels for MAC: rather than 2002-10-26 14:38:24 +00:00
pseudofs Since Jeffr made the std* functions the default in rev 1.63 of 2003-01-04 08:47:19 +00:00
smbfs Since Jeffr made the std* functions the default in rev 1.63 of 2003-01-04 08:47:19 +00:00
specfs Don't override the vop_lock, vop_unlock and vop_isunlocked methods. 2003-01-05 19:14:44 +00:00
udf Temporarily introduce a new VOP_SPECSTRATEGY operation while I try 2003-01-04 22:10:36 +00:00
umapfs umap_sync is empty and is identical to vfs_stdsync. Remove it and 2002-10-19 22:22:42 +00:00
unionfs Bow to the whining masses and change a union back into void *. Retain 2003-01-13 00:33:17 +00:00