summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_osd.c
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-04-29 21:14:15 +0000
committerjamie <jamie@FreeBSD.org>2009-04-29 21:14:15 +0000
commit453b86f943612b273e23c7de9941d00149802f15 (patch)
tree22957bdb61dcda0f3a60d42b6e80866c9764e591 /sys/kern/kern_osd.c
parent32a71137f08bc028578417de36a241d7e6011f58 (diff)
downloadFreeBSD-src-453b86f943612b273e23c7de9941d00149802f15.zip
FreeBSD-src-453b86f943612b273e23c7de9941d00149802f15.tar.gz
Introduce the extensible jail framework, using the same "name=value"
interface as nmount(2). Three new system calls are added: * jail_set, to create jails and change the parameters of existing jails. This replaces jail(2). * jail_get, to read the parameters of existing jails. This replaces the security.jail.list sysctl. * jail_remove to kill off a jail's processes and remove the jail. Most jail parameters may now be changed after creation, and jails may be set to exist without any attached processes. The current jail(2) system call still exists, though it is now a stub to jail_set(2). Approved by: bz (mentor)
Diffstat (limited to 'sys/kern/kern_osd.c')
-rw-r--r--sys/kern/kern_osd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c
index 8fc2f05..0aed19d 100644
--- a/sys/kern/kern_osd.c
+++ b/sys/kern/kern_osd.c
@@ -72,7 +72,9 @@ static LIST_HEAD(, osd) osd_list[OSD_LAST + 1]; /* (m) */
static osd_method_t *osd_methods[OSD_LAST + 1]; /* (m) */
static u_int osd_nslots[OSD_LAST + 1]; /* (m) */
static osd_destructor_t *osd_destructors[OSD_LAST + 1]; /* (o) */
-static const u_int osd_nmethods[OSD_LAST + 1];
+static const u_int osd_nmethods[OSD_LAST + 1] = {
+ [OSD_JAIL] = 5,
+};
static struct sx osd_module_lock[OSD_LAST + 1];
static struct rmlock osd_object_lock[OSD_LAST + 1];
@@ -345,9 +347,9 @@ osd_call(u_int type, u_int method, void *obj, void *data)
*/
error = 0;
sx_slock(&osd_module_lock[type]);
- for (i = 1; i <= osd_nslots[type]; i++) {
+ for (i = 0; i < osd_nslots[type]; i++) {
methodfun =
- osd_methods[type][(i - 1) * osd_nmethods[type] + method];
+ osd_methods[type][i * osd_nmethods[type] + method];
if (methodfun != NULL && (error = methodfun(obj, data)) != 0)
break;
}
OpenPOWER on IntegriCloud