- Fix a logic error in checking the securelevel that was introduced in the

previous commit.

Pointy hats to: arr, rwatson
This commit is contained in:
arr 2002-03-21 15:27:39 +00:00
parent ec2a00af74
commit 68e226a99e
3 changed files with 4 additions and 8 deletions

View File

@ -700,10 +700,8 @@ kldload(struct thread *td, struct kldload_args *uap)
mtx_lock(&Giant);
if (securelevel_gt(td->td_ucred, 0) == 0) {
error = EPERM;
if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
goto out;
}
if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
goto out;
@ -749,10 +747,8 @@ kldunload(struct thread *td, struct kldunload_args *uap)
mtx_lock(&Giant);
if (securelevel_gt(td->td_ucred, 0) == 0) {
error = EPERM;
if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
goto out;
}
if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
goto out;

View File

@ -308,7 +308,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
return error;
}
error = securelevel_gt(td->td_ucred, 0);
if (error == 0) {
if (error != 0) {
vput(vp);
return (EPERM);
}

View File

@ -308,7 +308,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata)
return error;
}
error = securelevel_gt(td->td_ucred, 0);
if (error == 0) {
if (error != 0) {
vput(vp);
return (EPERM);
}