aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-15 19:17:52 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-15 19:17:52 +0000
commit9c373a81a380a40c338398568ef2eab677d8bc00 (patch)
treefa0fa19b7b868432e961c6655510a999e74566d3 /sys/kern/tty.c
parent9ed47d01eb935541b9cafd369eb653c35cce7067 (diff)
downloadsrc-9c373a81a380a40c338398568ef2eab677d8bc00.tar.gz
src-9c373a81a380a40c338398568ef2eab677d8bc00.zip
Notes
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 162ae372633c..bf800be0e44c 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1487,15 +1487,18 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td)
}
if (p->p_session->s_ttyvp != NULL ||
- (tp->t_session != NULL && tp->t_session->s_ttyvp != NULL)) {
+ (tp->t_session != NULL && tp->t_session->s_ttyvp != NULL &&
+ tp->t_session->s_ttyvp->v_type != VBAD)) {
/*
* There is already a relation between a TTY and
* a session, or the caller is not the session
* leader.
*
* Allow the TTY to be stolen when the vnode is
- * NULL, but the reference to the TTY is still
- * active.
+ * invalid, but the reference to the TTY is
+ * still active. This allows immediate reuse of
+ * TTYs of which the session leader has been
+ * killed or the TTY revoked.
*/
sx_xunlock(&proctree_lock);
return (EPERM);