diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-05-07 09:35:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-05-07 09:35:53 +0000 |
commit | 8c13200843e7f7685732f6d004bd880647966255 (patch) | |
tree | c627e4e5758e5af82fdf900a3166ae537c43d2da /sys/kern/tty_pty.c | |
parent | f29334177d06e2d052db3460f8be4f39a22900bb (diff) |
check TIOCSIG for 0 and do not send that to psignal() and pgsignal()
ok fgsch
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r-- | sys/kern/tty_pty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 0671ba7fe1b..c469ca886f0 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.36 2008/04/10 19:55:41 deraadt Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.37 2008/05/07 09:35:52 deraadt Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -809,8 +809,7 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) tp->t_lflag &= ~EXTPROC; } return(0); - } else - if (cdevsw[major(dev)].d_open == ptcopen) + } else if (cdevsw[major(dev)].d_open == ptcopen) switch (cmd) { case TIOCGPGRP: @@ -874,7 +873,8 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) break; case TIOCSIG: - if (*(unsigned int *)data >= NSIG) + if (*(unsigned int *)data >= NSIG || + *(unsigned int *)data == 0) return(EINVAL); if ((tp->t_lflag&NOFLSH) == 0) ttyflush(tp, FREAD|FWRITE); |