diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-09-26 20:20:05 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-09-26 20:20:05 +0000 |
commit | 53363e1502b6827a33fcb60f020120c57d0a90d9 (patch) | |
tree | 371668d8c4cd1175a9800f9f441414992c1fe9b8 | |
parent | c9c82b43c3b67649e07ebe33426871afc1cdc864 (diff) | |
download | FreeBSD-src-53363e1502b6827a33fcb60f020120c57d0a90d9.zip FreeBSD-src-53363e1502b6827a33fcb60f020120c57d0a90d9.tar.gz |
o Modify spigot_open() to use securelevel_gt() instead of direct
securelevel variable checks.
Obtained from: TrustedBSD Project
-rw-r--r-- | sys/i386/isa/spigot.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index 0bd87ff..f41b763 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -182,8 +182,9 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; error = suser_td(td); if (error != 0) return error; - if (securelevel > 0) - return EPERM; + error = securelevel_gt(p, 0); + if (error != 0) + return error; #endif ss->flags |= OPEN; @@ -238,8 +239,9 @@ struct spigot_info *info; error = suser_td(td); if (error != 0) return error; - if (securelevel > 0) - return EPERM; + error = securelevel_gt(p->p_ucred, 0); + if (error) + return error; #endif td->td_frame->tf_eflags |= PSL_IOPL; break; |