summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-05-29 21:27:12 +0000
committerjamie <jamie@FreeBSD.org>2009-05-29 21:27:12 +0000
commit572db1408a55640213faa331981d20cda01f68d8 (patch)
tree36c53629863ffb1eb32354e9a24549059dd6273f /sys/kern/kern_shutdown.c
parent64785ac65985d6800df1bacd80b5a3ba30b36b27 (diff)
downloadFreeBSD-src-572db1408a55640213faa331981d20cda01f68d8.zip
FreeBSD-src-572db1408a55640213faa331981d20cda01f68d8.tar.gz
Place hostnames and similar information fully under the prison system.
The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor)
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 7702ad8..3fc2e72 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/eventhandler.h>
+#include <sys/jail.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
@@ -65,7 +66,6 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h> /* smp_active */
#include <sys/sysctl.h>
#include <sys/sysproto.h>
-#include <sys/vimage.h>
#include <ddb/ddb.h>
@@ -693,7 +693,7 @@ mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver,
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, G_hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, prison0.pr_host, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
OpenPOWER on IntegriCloud