]>
git.ipfire.org Git - thirdparty/util-linux.git/commit
su: (pty) change owner and mode for pty
The current situation:
# su --pty - kzak
$ ll $(tty)
crw--w---- 1 root tty 136, 9 Feb 23 11:53 /dev/pts/9
$ mesg
mesg: cannot open /dev/pts/9: Permission denied
the pseudo-terminal is still owned by the original user.
New version:
# su --pty - kzak
# ll $(tty)
crw--w---- 1 kzak tty 136, 9 Feb 23 11:56 /dev/pts/9
# mesg
is y
The patch follows login(1) to change the pty owner and group. It
follows "TTYPERM" and "TTYGROUP" from login.defs (or econf lib).
Signed-off-by: Karel Zak <kzak@redhat.com>