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
3459e1d2e9
commit
397b3428eb
@ -96,10 +96,8 @@ osethostname(td, uap)
|
|||||||
name[0] = CTL_KERN;
|
name[0] = CTL_KERN;
|
||||||
name[1] = KERN_HOSTNAME;
|
name[1] = KERN_HOSTNAME;
|
||||||
mtx_lock(&Giant);
|
mtx_lock(&Giant);
|
||||||
if ((error = suser_cred(td->td_ucred, SUSER_ALLOWJAIL)) == 0) {
|
error = userland_sysctl(td, name, 2, 0, 0, 0, uap->hostname,
|
||||||
error = userland_sysctl(td, name, 2, 0, 0, 0,
|
uap->len, 0, 0);
|
||||||
uap->hostname, uap->len, 0, 0);
|
|
||||||
}
|
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user