1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Back out part of rev. 1.149. While adding a workaround in ptcopen() to

avoid leaked ptys works fine, this opens a possible security hole.

Submitted by:	bde
MFC after:	3 days
This commit is contained in:
Martin Blapp 2006-10-04 05:43:39 +00:00
parent 011a0a0432
commit 89ff1e4cb8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162997

View File

@ -335,15 +335,8 @@ ptcopen(struct cdev *dev, int flag, int devtype, struct thread *td)
}
tp = dev->si_tty;
if (tp->t_oproc) {
/*
* Only return if we have a non empty
* state to avoid leakage. Workaround for
* vfs bugs and complications near revoke().
*/
if (tp->t_state != 0x0 || tp->t_refcnt > 1)
return (EIO);
}
if (tp->t_oproc)
return (EIO);
tp->t_timeout = -1;
tp->t_oproc = ptsstart;
tp->t_stop = ptsstop;