diff options
author | ache <ache@FreeBSD.org> | 1994-12-04 01:46:13 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-12-04 01:46:13 +0000 |
commit | 117476758a3528e93982b9dfb4473aa8515ac5b0 (patch) | |
tree | a6d655dc076672cf072a34fce0c022c9b8af0580 /sys/kern/tty_tty.c | |
parent | 7eaf06fb5b26cc450e869b0b5b0bbc7a00bbff84 (diff) | |
download | FreeBSD-src-117476758a3528e93982b9dfb4473aa8515ac5b0.zip FreeBSD-src-117476758a3528e93982b9dfb4473aa8515ac5b0.tar.gz |
don't allow ctty to be set to ctty - infinite kernel recursion
Obtained from: 1.1.5.1
Diffstat (limited to 'sys/kern/tty_tty.c')
-rw-r--r-- | sys/kern/tty_tty.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index b710d5b..e3c5035 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_tty.c 8.2 (Berkeley) 9/23/93 - * $Id$ + * $Id: tty_tty.c,v 1.3 1994/08/02 07:42:57 davidg Exp $ */ /* @@ -128,6 +128,8 @@ cttyioctl(dev, cmd, addr, flag, p) if (ttyvp == NULL) return (EIO); + if (cmd == TIOCSCTTY) /* don't allow controlling tty to be set */ + return EINVAL; /* to controlling tty -- infinite recursion */ if (cmd == TIOCNOTTY) { if (!SESS_LEADER(p)) { p->p_flag &= ~P_CONTROLT; |