From 5597f0ccf2e5f57b59dcc79a398705a5d8ed2bf6 Mon Sep 17 00:00:00 2001 From: Robert Drehmel Date: Wed, 27 Feb 2002 15:06:33 +0000 Subject: [PATCH] Use the getcredhostname function to fill the hostname into the linux_newuname_args structure. This should fix the case of jailed linux processes not using the jail's hostname. PR: 35336 Reviewed by: phk --- sys/compat/linux/linux_misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 5be79bd4a79..562b37f4d30 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -701,7 +702,8 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args) bzero(&utsname, sizeof(utsname)); strncpy(utsname.sysname, osname, LINUX_MAX_UTSNAME-1); - strncpy(utsname.nodename, hostname, LINUX_MAX_UTSNAME-1); + strncpy(utsname.nodename, getcredhostname(td->td_ucred), + LINUX_MAX_UTSNAME-1); strncpy(utsname.release, osrelease, LINUX_MAX_UTSNAME-1); strncpy(utsname.version, version, LINUX_MAX_UTSNAME-1); strncpy(utsname.machine, machine, LINUX_MAX_UTSNAME-1);