mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
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
This commit is contained in:
parent
9484d0c0e8
commit
5597f0ccf2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91385
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user