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:
rwatson 2004-10-22 12:10:50 +00:00
parent 9ca72eac8f
commit 00f1836c10

View File

@ -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);
}