[106] in linux-security and linux-alert archive
Re: tty permissions
daemon@ATHENA.MIT.EDU (Andries.Brouwer@cwi.nl)
Sat Mar 11 11:59:27 1995
Date: Sat, 11 Mar 1995 16:00:28 +0100
From: Andries.Brouwer@cwi.nl
To: R.E.Wolff@et.tudelft.nl, linux-security@tarsier.cv.nrao.edu
Reply-To: linux-security@tarsier.cv.nrao.edu
: >
: > (I, and most people I know, have had "mesg n" in .profile the past
: > twenty years or so; giving people write permission to your tty
: > allows them to log you off ("stty 0 < /dev/tty1"), or do very obscure
: You correctly indicate that stty operates on its INPUT.
: Giving people write permission on your tty doesn't affect this.
Unfortunately it does.
The ioctls used by stty (via the library call tcsetattr) just
operate on a file descriptor, and don't care whether it is open for
reading or writing. Try "stty -onlcr > /dev/tty2 0<&1" while
you are in "cat" on tty2.
(The situation is obscured a bit by the fact that bash changes tty
modes all the time; roughly speaking, the idea is that bash reads
the tty state upon successful completion of a job, and sets the
tty state when a job returns an error, or is stopped using job control;
the details are more complicated.)