mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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
1 changed files with 3 additions and 1 deletions
|
|
@ -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 a new issue