diff options
author | robert <robert@FreeBSD.org> | 2002-02-27 15:06:33 +0000 |
---|---|---|
committer | robert <robert@FreeBSD.org> | 2002-02-27 15:06:33 +0000 |
commit | 99ec5ad86f59dbcf96f622255812e20b138ae865 (patch) | |
tree | 8b02876d3e204ccc0cf197acfa9875bf24c7b415 /sys/compat/linux | |
parent | 1adc111a4d822285509235f8eb5eb6624194a312 (diff) | |
download | FreeBSD-src-99ec5ad86f59dbcf96f622255812e20b138ae865.zip FreeBSD-src-99ec5ad86f59dbcf96f622255812e20b138ae865.tar.gz |
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
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 <sys/systm.h> #include <sys/fcntl.h> #include <sys/imgact_aout.h> +#include <sys/jail.h> #include <sys/kernel.h> #include <sys/lock.h> #include <sys/mman.h> @@ -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); |