Deleted Added
full compact
kern_jail.c (244404) kern_jail.c (250804)
1/*-
2 * Copyright (c) 1999 Poul-Henning Kamp.
3 * Copyright (c) 2008 Bjoern A. Zeeb.
4 * Copyright (c) 2009 James Gritton.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999 Poul-Henning Kamp.
3 * Copyright (c) 2008 Bjoern A. Zeeb.
4 * Copyright (c) 2009 James Gritton.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/kern/kern_jail.c 244404 2012-12-18 18:34:36Z mjg $");
30__FBSDID("$FreeBSD: head/sys/kern/kern_jail.c 250804 2013-05-19 04:10:34Z jamie $");
31
32#include "opt_compat.h"
33#include "opt_ddb.h"
34#include "opt_inet.h"
35#include "opt_inet6.h"
36
37#include <sys/param.h>
38#include <sys/types.h>

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

4127
4128 return (error);
4129}
4130
4131SYSCTL_PROC(_security_jail, OID_AUTO, jailed,
4132 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
4133 sysctl_jail_jailed, "I", "Process in jail?");
4134
31
32#include "opt_compat.h"
33#include "opt_ddb.h"
34#include "opt_inet.h"
35#include "opt_inet6.h"
36
37#include <sys/param.h>
38#include <sys/types.h>

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

4127
4128 return (error);
4129}
4130
4131SYSCTL_PROC(_security_jail, OID_AUTO, jailed,
4132 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
4133 sysctl_jail_jailed, "I", "Process in jail?");
4134
4135static int
4136sysctl_jail_vnet(SYSCTL_HANDLER_ARGS)
4137{
4138 int error, havevnet;
4139#ifdef VIMAGE
4140 struct ucred *cred = req->td->td_ucred;
4141
4142 havevnet = jailed(cred) && prison_owns_vnet(cred);
4143#else
4144 havevnet = 0;
4145#endif
4146 error = SYSCTL_OUT(req, &havevnet, sizeof(havevnet));
4147
4148 return (error);
4149}
4150
4151SYSCTL_PROC(_security_jail, OID_AUTO, vnet,
4152 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
4153 sysctl_jail_vnet, "I", "Jail owns VNET?");
4154
4135#if defined(INET) || defined(INET6)
4136SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW,
4137 &jail_max_af_ips, 0,
4138 "Number of IP addresses a jail may have at most per address family");
4139#endif
4140
4141/*
4142 * Default parameters for jail(2) compatability. For historical reasons,

--- 500 unchanged lines hidden ---
4155#if defined(INET) || defined(INET6)
4156SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW,
4157 &jail_max_af_ips, 0,
4158 "Number of IP addresses a jail may have at most per address family");
4159#endif
4160
4161/*
4162 * Default parameters for jail(2) compatability. For historical reasons,

--- 500 unchanged lines hidden ---