- 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:
parent
ec2a00af74
commit
68e226a99e
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user