From 330e78897a777a14b314b25dd774cd70ff6572aa Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 26 Sep 2001 20:08:15 +0000 Subject: [PATCH] o Modify i386_set_ioperm() to use securelevel_gt() instead of direct securelevel variable checks. Obtained from: TrustedBSD Project --- sys/amd64/amd64/sys_machdep.c | 4 ++-- sys/i386/i386/sys_machdep.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index acca4e7cb5c..dc9022c7b39 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -185,8 +185,8 @@ i386_set_ioperm(td, args) if ((error = suser_td(td)) != 0) return (error); - if (securelevel > 0) - return (EPERM); + if ((error = securelevel_gt(td->td_proc->p_ucred, 0)) != 0) + return (error); /* * XXX * While this is restricted to root, we should probably figure out diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index acca4e7cb5c..dc9022c7b39 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -185,8 +185,8 @@ i386_set_ioperm(td, args) if ((error = suser_td(td)) != 0) return (error); - if (securelevel > 0) - return (EPERM); + if ((error = securelevel_gt(td->td_proc->p_ucred, 0)) != 0) + return (error); /* * XXX * While this is restricted to root, we should probably figure out