o securelevel_gt() patches came from pre-KSE alpha -- this revision

fixes the compile and uses td->td_proc instead of p.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2001-09-26 20:27:23 +00:00
parent e8a340cd9a
commit 3026f29e34
2 changed files with 9 additions and 4 deletions

View File

@ -116,12 +116,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

View File

@ -114,8 +114,9 @@ alpha_sethae(struct thread *td, char *args)
if (error)
return (error);
if (securelevel > 0)
return (EPERM);
error = securelevel_gt(td->td_proc->p_ucred, 0);
if (error)
return (error);
error = suser(td->td_proc);
if (error)