diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-11-01 20:56:57 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-11-01 20:56:57 +0000 |
commit | c532c3bf88b0296935bf9293accb407de43e240c (patch) | |
tree | d29ed0901454dffcc55e4c0606aef0cd915d84eb /sys/kern/tty.c | |
parent | 49a98043879675541ed4fda938748b3b157c8479 (diff) | |
download | FreeBSD-src-c532c3bf88b0296935bf9293accb407de43e240c.zip FreeBSD-src-c532c3bf88b0296935bf9293accb407de43e240c.tar.gz |
o Move suser() calls in kern/ to using suser_xxx() with an explicit
credential selection, rather than reference via a thread or process
pointer. This is part of a gradual migration to suser() accepting
a struct ucred instead of a struct proc, simplifying the reference
and locking semantics of suser().
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 13ab4f7..efc76b8 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -822,7 +822,7 @@ ttioctl(tp, cmd, data, flag) ISSET(constty->t_state, TS_CONNECTED)) return (EBUSY); #ifndef UCONSOLE - if ((error = suser(p)) != 0) + if ((error = suser_xxx(p->p_ucred, NULL, 0)) != 0) return (error); #endif constty = tp; @@ -994,9 +994,9 @@ ttioctl(tp, cmd, data, flag) splx(s); break; case TIOCSTI: /* simulate terminal input */ - if ((flag & FREAD) == 0 && suser(p)) + if ((flag & FREAD) == 0 && suser_xxx(p->p_ucred, NULL, 0)) return (EPERM); - if (!isctty(p, tp) && suser(p)) + if (!isctty(p, tp) && suser_xxx(p->p_ucred, NULL, 0)) return (EACCES); s = spltty(); (*linesw[tp->t_line].l_rint)(*(u_char *)data, tp); @@ -1044,7 +1044,7 @@ ttioctl(tp, cmd, data, flag) } break; case TIOCSDRAINWAIT: - error = suser(p); + error = suser_xxx(p->p_ucred, NULL, 0); if (error) return (error); tp->t_timeout = *(int *)data * hz; |