- Use the new getcredhostname function in xenix_utsname(),

ibcs2_getipdomainname(), and ibcs2_utssys().

Reviewed by:	phk
This commit is contained in:
Robert Drehmel 2002-02-27 15:23:01 +00:00
parent 8f4c8256b2
commit 9fdb8219fa
3 changed files with 9 additions and 4 deletions

View File

@ -28,6 +28,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
@ -148,7 +149,8 @@ ibcs2_getipdomainname(td, uap)
int len;
/* Get the domain name */
snprintf(hname, sizeof(hname), "%s", hostname);
snprintf(hname, sizeof(hname), "%s", getcredhostname(td->td_ucred));
dptr = index(hname, '.');
if ( dptr )
dptr++;

View File

@ -34,6 +34,7 @@
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/filedesc.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/vnode.h>
@ -233,7 +234,8 @@ ibcs2_utssys(td, uap)
IBCS2_UNAME_RELEASE, sizeof(sut.release) - 1);
strncpy(sut.version,
IBCS2_UNAME_VERSION, sizeof(sut.version) - 1);
strncpy(machine_name, hostname, sizeof(machine_name) - 1);
strncpy(machine_name, getcredhostname(td->td_ucred),
sizeof(machine_name) - 1);
machine_name[sizeof(machine_name) - 1] = 0;
p = index(machine_name, '.');
if ( p )

View File

@ -34,6 +34,7 @@
#include <sys/systm.h>
#include <sys/namei.h>
#include <sys/sysproto.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/filio.h>
#include <sys/vnode.h>
@ -160,8 +161,8 @@ xenix_utsname(struct thread *td, struct xenix_utsname_args *uap)
bzero(&ibcs2_sco_uname, sizeof(struct ibcs2_sco_utsname));
strncpy(ibcs2_sco_uname.sysname, ostype,
sizeof(ibcs2_sco_uname.sysname) - 1);
strncpy(ibcs2_sco_uname.nodename, hostname,
sizeof(ibcs2_sco_uname.nodename) - 1);
strncpy(ibcs2_sco_uname.nodename, getcredhostname(td->td_ucred),
sizeof(ibcs2_sco_uname.nodename) - 1);
strncpy(ibcs2_sco_uname.release, osrelease,
sizeof(ibcs2_sco_uname.release) - 1);
strncpy(ibcs2_sco_uname.kernelid, version,