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:
parent
e8a340cd9a
commit
3026f29e34
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user