summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-11-08 17:06:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-14 06:59:48 +0300
commitd1d3a0f7448fe038ce7e94e2c281dcd2f91b23c6 (patch)
tree8de2708afcb48978fc33e2d0e9a5e9fc4ddce8d7 /drivers/tty/tty_io.c
parent83db1df4461c8731a413cd6cb1cbf351f01a57b1 (diff)
downloadlinux-d1d3a0f7448fe038ce7e94e2c281dcd2f91b23c6.tar.xz
tty: Only allow slave pty as controlling tty
A master pty should never be a controlling tty in Linux; if the master pty is specified to ioctl(TIOCSCTTY), silently substitute the slave pty as the controlling tty. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index f38ae01c3917..892c92354745 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2866,7 +2866,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
no_tty();
return 0;
case TIOCSCTTY:
- return tiocsctty(tty, file, arg);
+ return tiocsctty(real_tty, file, arg);
case TIOCGPGRP:
return tiocgpgrp(tty, real_tty, p);
case TIOCSPGRP: