From 99ec5ad86f59dbcf96f622255812e20b138ae865 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 27 Feb 2002 15:06:33 +0000 Subject: 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(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 5be79bd..562b37f 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); -- cgit v1.1