diff options
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 10 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 20 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 7279197..dc8edf5 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include <sys/vnode.h> #include <sys/wait.h> #include <sys/cpuset.h> -#include <sys/vimage.h> #include <security/mac/mac_framework.h> @@ -715,10 +714,10 @@ linux_times(struct thread *td, struct linux_times_args *args) int linux_newuname(struct thread *td, struct linux_newuname_args *args) { - INIT_VPROCG(TD_TO_VPROCG(td)); struct l_new_utsname utsname; char osname[LINUX_MAX_UTSNAME]; char osrelease[LINUX_MAX_UTSNAME]; + struct prison *pr; char *p; #ifdef DEBUG @@ -741,9 +740,10 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args) } strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME); - mtx_lock(&hostname_mtx); - strlcpy(utsname.domainname, V_domainname, LINUX_MAX_UTSNAME); - mtx_unlock(&hostname_mtx); + pr = td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(utsname.domainname, pr->pr_domain, LINUX_MAX_UTSNAME); + mtx_unlock(&pr->pr_mtx); return (copyout(&utsname, args->buf, sizeof(utsname))); } diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 8c7b9b8..42e6122 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/sysproto.h> #include <sys/un.h> -#include <sys/vimage.h> #include <vm/vm.h> @@ -386,7 +385,7 @@ svr4_ustat(td, uap) return 0; } -/*extern char ostype[], hostname[], osrelease[], version[], machine[];*/ +/*extern char ostype[], osrelease[], version[], machine[];*/ int svr4_sys_uname(td, uap) @@ -412,15 +411,12 @@ svr4_sys_systeminfo(td, uap) struct thread *td; struct svr4_sys_systeminfo_args *uap; { - INIT_VPROCG(TD_TO_VPROCG(td)); + struct prison *pr; char *str = NULL; int error = 0; register_t *retval = td->td_retval; size_t len = 0; - char buf[11]; /* XXX NetBSD uses 256, but we use 11 - here as that seems like awfully - excessive kstack usage for hostid - string... */ + char buf[MAXHOSTNAMELEN]; u_int rlen = uap->len; switch (uap->what) { @@ -429,7 +425,8 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HOSTNAME: - str = V_hostname; + getcredhostname(td->td_ucred, buf, sizeof(buf)); + str = buf; break; case SVR4_SI_RELEASE: @@ -470,8 +467,11 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_SRPC_DOMAIN: - /* XXXRW: locking? */ - str = V_domainname; + pr = td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(buf, pr->pr_domain, sizeof(buf)); + mtx_unlock(&pr->pr_mtx); + str = buf; break; case SVR4_SI_PLATFORM: |