summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-05-27 14:11:23 +0000
committerjamie <jamie@FreeBSD.org>2009-05-27 14:11:23 +0000
commita013e0afcbb44052a86a7977277d669d8883b7e7 (patch)
treeb7f782d79e61a1bd80655a068684cb0fd9f39922 /sys/nfsserver
parent6e53147404a7f4fb4173694bc812d9d23efd9fef (diff)
downloadFreeBSD-src-a013e0afcbb44052a86a7977277d669d8883b7e7.zip
FreeBSD-src-a013e0afcbb44052a86a7977277d669d8883b7e7.tar.gz
Add hierarchical jails. A jail may further virtualize its environment
by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor)
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_srvsock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 6f42e31..639772b 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -699,6 +700,8 @@ nfsrv_dorec(struct nfssvc_sock *slp, struct nfsd *nfsd,
nd = malloc(sizeof (struct nfsrv_descript),
M_NFSRVDESC, M_WAITOK);
nd->nd_cr = crget();
+ prison_hold(&prison0);
+ nd->nd_cr->cr_prison = &prison0;
NFSD_LOCK();
nd->nd_md = nd->nd_mrep = m;
nd->nd_nam2 = nam;
OpenPOWER on IntegriCloud