kern_jail.c (187684) | kern_jail.c (187864) |
---|---|
1/*- 2 * Copyright (c) 1999 Poul-Henning Kamp. 3 * Copyright (c) 2008 Bjoern A. Zeeb. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999 Poul-Henning Kamp. 3 * Copyright (c) 2008 Bjoern A. Zeeb. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/kern/kern_jail.c 187684 2009-01-25 10:11:58Z bz $"); | 29__FBSDID("$FreeBSD: head/sys/kern/kern_jail.c 187864 2009-01-28 19:58:05Z ed $"); |
30 31#include "opt_ddb.h" 32#include "opt_inet.h" 33#include "opt_inet6.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/types.h> --- 1486 unchanged lines hidden (view full) --- 1524 } 1525 sx_sunlock(&allprison_lock); 1526 1527 error = SYSCTL_OUT(req, sxp, len); 1528 free(sxp, M_TEMP); 1529 return (error); 1530} 1531 | 30 31#include "opt_ddb.h" 32#include "opt_inet.h" 33#include "opt_inet6.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/types.h> --- 1486 unchanged lines hidden (view full) --- 1524 } 1525 sx_sunlock(&allprison_lock); 1526 1527 error = SYSCTL_OUT(req, sxp, len); 1528 free(sxp, M_TEMP); 1529 return (error); 1530} 1531 |
1532SYSCTL_OID(_security_jail, OID_AUTO, list, CTLTYPE_STRUCT | CTLFLAG_RD, 1533 NULL, 0, sysctl_jail_list, "S", "List of active jails"); | 1532SYSCTL_OID(_security_jail, OID_AUTO, list, 1533 CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, 1534 sysctl_jail_list, "S", "List of active jails"); |
1534 1535static int 1536sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) 1537{ 1538 int error, injail; 1539 1540 injail = jailed(req->td->td_ucred); 1541 error = SYSCTL_OUT(req, &injail, sizeof(injail)); 1542 1543 return (error); 1544} | 1535 1536static int 1537sysctl_jail_jailed(SYSCTL_HANDLER_ARGS) 1538{ 1539 int error, injail; 1540 1541 injail = jailed(req->td->td_ucred); 1542 error = SYSCTL_OUT(req, &injail, sizeof(injail)); 1543 1544 return (error); 1545} |
1545SYSCTL_PROC(_security_jail, OID_AUTO, jailed, CTLTYPE_INT | CTLFLAG_RD, 1546 NULL, 0, sysctl_jail_jailed, "I", "Process in jail?"); | 1546SYSCTL_PROC(_security_jail, OID_AUTO, jailed, 1547 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, 1548 sysctl_jail_jailed, "I", "Process in jail?"); |
1547 1548#ifdef DDB 1549DB_SHOW_COMMAND(jails, db_show_jails) 1550{ 1551 struct prison *pr; 1552#ifdef INET 1553 struct in_addr ia; 1554#endif --- 49 unchanged lines hidden --- | 1549 1550#ifdef DDB 1551DB_SHOW_COMMAND(jails, db_show_jails) 1552{ 1553 struct prison *pr; 1554#ifdef INET 1555 struct in_addr ia; 1556#endif --- 49 unchanged lines hidden --- |