-#ifdef PARANOID
- /*
- * Since group is tty and mode is 620 on most terminal lines
- * and since sessions protect terminals from processes outside
- * your session, this check is probably no longer necessary.
- * Since it inhibits setuid root programs that later switch
- * to another user from accessing /dev/tty, we have decided
- * to delete this test. (mckusick 5/93)
- */
- error = VOP_ACCESS(ttyvp,
- (flag&FREAD ? VREAD : 0) | (flag&FWRITE ? VWRITE : 0), p->p_ucred, p);
- if (!error)
-#endif /* PARANOID */
- error = VOP_OPEN(ttyvp, flag, NOCRED, p);
- VOP_UNLOCK(ttyvp, 0, p);
+ context.vc_proc = p;
+ context.vc_ucred = p->p_ucred;
+ error = VNOP_OPEN(ttyvp, flag, &context);
+