o Modify the access control checks for the ia64 /dev/mem (and friends)

to use securelevel_gt() instead of direct variable checks.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2001-09-26 20:24:23 +00:00
parent 54045486e0
commit b9c6f21493

View File

@ -115,12 +115,16 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td)
static int
mmopen(dev_t dev, int flags, int fmt, struct thread *td)
{
int error;
switch (minor(dev)) {
case 0:
case 1:
if ((flags & FWRITE) && securelevel > 0)
return (EPERM);
if (flags & FWRITE) {
error = securelevel_gt(td->td_proc->p_ucred, 0);
if (error)
return error;
}
break;
case 32:
#ifdef PERFMON