In osethostname(), don't need to call suser() directly as
userland_sysctl() will perform all necessary privilege checks for the caller.
This commit is contained in:
parent
9ca72eac8f
commit
00f1836c10
@ -96,10 +96,8 @@ osethostname(td, uap)
|
||||
name[0] = CTL_KERN;
|
||||
name[1] = KERN_HOSTNAME;
|
||||
mtx_lock(&Giant);
|
||||
if ((error = suser_cred(td->td_ucred, SUSER_ALLOWJAIL)) == 0) {
|
||||
error = userland_sysctl(td, name, 2, 0, 0, 0,
|
||||
uap->hostname, uap->len, 0, 0);
|
||||
}
|
||||
error = userland_sysctl(td, name, 2, 0, 0, 0, uap->hostname,
|
||||
uap->len, 0, 0);
|
||||
mtx_unlock(&Giant);
|
||||
return (error);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user