Deleted Added
full compact
kern_jail.c (109623) kern_jail.c (111119)
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * $FreeBSD: head/sys/kern/kern_jail.c 109623 2003-01-21 08:56:16Z alfred $
9 * $FreeBSD: head/sys/kern/kern_jail.c 111119 2003-02-19 05:47:46Z imp $
10 *
11 */
12
13#include <sys/param.h>
14#include <sys/types.h>
15#include <sys/kernel.h>
16#include <sys/systm.h>
17#include <sys/errno.h>

--- 49 unchanged lines hidden (view full) ---

67 struct ucred *newcred = NULL, *oldcred;
68
69 error = copyin(uap->jail, &j, sizeof j);
70 if (error)
71 return (error);
72 if (j.version != 0)
73 return (EINVAL);
74
10 *
11 */
12
13#include <sys/param.h>
14#include <sys/types.h>
15#include <sys/kernel.h>
16#include <sys/systm.h>
17#include <sys/errno.h>

--- 49 unchanged lines hidden (view full) ---

67 struct ucred *newcred = NULL, *oldcred;
68
69 error = copyin(uap->jail, &j, sizeof j);
70 if (error)
71 return (error);
72 if (j.version != 0)
73 return (EINVAL);
74
75 MALLOC(pr, struct prison *, sizeof *pr , M_PRISON, M_ZERO);
75 MALLOC(pr, struct prison *, sizeof *pr , M_PRISON, M_WAITOK | M_ZERO);
76 mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF);
77 pr->pr_securelevel = securelevel;
78 error = copyinstr(j.hostname, &pr->pr_host, sizeof pr->pr_host, 0);
79 if (error)
80 goto bail;
81 ca.path = j.path;
82 mtx_lock(&Giant);
83 error = chroot(td, &ca);

--- 175 unchanged lines hidden ---
76 mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF);
77 pr->pr_securelevel = securelevel;
78 error = copyinstr(j.hostname, &pr->pr_host, sizeof pr->pr_host, 0);
79 if (error)
80 goto bail;
81 ca.path = j.path;
82 mtx_lock(&Giant);
83 error = chroot(td, &ca);

--- 175 unchanged lines hidden ---