1/*-
2 * Copyright (c) 2010 James Gritton.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: projects/jailconf/usr.sbin/jail/jailp.h 223188 2011-06-17 16:06:13Z jamie $
27 */
28
29#include <sys/param.h>
30#include <sys/types.h>
31#include <sys/jail.h>
32#include <sys/queue.h>
33#include <sys/time.h>
34
--- 19 unchanged lines hidden (view full) ---
54#define JF_START 0x0001 /* -c */
55#define JF_SET 0x0002 /* -m */
56#define JF_STOP 0x0004 /* -r */
57#define JF_DEPEND 0x0008 /* Operation required by dependency */
58#define JF_WILD 0x0010 /* Not specified on the command line */
59#define JF_FAILED 0x0020 /* Operation failed */
60#define JF_PARAMS 0x0040 /* Parameters checked and imported */
61#define JF_RDTUN 0x0080 /* Create-only parameter check has been done */
62#define JF_IFUP 0x0100 /* IP addresses have been configured */
63#define JF_MOUNTED 0x0200 /* Filesystems have been mounted */
64#define JF_PERSIST 0x0400 /* Jail is temporarily persistent */
65#define JF_TIMEOUT 0x0800 /* A command (or process kill) timed out */
66#define JF_SLEEPQ 0x2000 /* Waiting on a command and/or timeout */
67
68#define JF_OP_MASK (JF_START | JF_SET | JF_STOP)
69#define JF_RESTART (JF_START | JF_STOP)
70#define JF_START_SET (JF_START | JF_SET)
71#define JF_SET_RESTART (JF_SET | JF_STOP)
72#define JF_START_SET_RESTART (JF_START | JF_SET | JF_STOP)
73#define JF_DO_STOP(js) (((js) & (JF_SET | JF_STOP)) == JF_STOP)
74
--- 22 unchanged lines hidden (view full) ---
97 IP_MOUNT_FSTAB, /* A standard fstab(5) file */
98 IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */
99 IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */
100 IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */
101#ifdef INET6
102 IP__IP6_IFADDR, /* Copy of ip6.addr with interface/prefixlen */
103#endif
104 IP__MOUNT_FROM_FSTAB, /* Line from mount.fstab file */
105 KP_ALLOW_CHFLAGS,
106 KP_ALLOW_MOUNT,
107 KP_ALLOW_RAW_SOCKETS,
108 KP_ALLOW_SET_HOSTNAME,
109 KP_ALLOW_SOCKET_AF,
110 KP_ALLOW_SYSVIPC,
111 KP_ENFORCE_STATFS,
112 KP_HOST_HOSTNAME,
--- 46 unchanged lines hidden (view full) ---
159 char *comline;
160 struct cfparams params;
161 struct cfdepends dep[2];
162 struct cfjails *queue;
163 struct cfparam *intparams[IP_NPARAM];
164 struct cfstring *comstring;
165 struct jailparam *jp;
166 struct timespec timeout;
167 enum intparam comparam;
168 unsigned flags;
169 int jid;
170 int seq;
171 int pstatus;
172 int ndeps;
173 int njp;
174 int nprocs;
175};
--- 6 unchanged lines hidden (view full) ---
182
183extern void *emalloc(size_t);
184extern void *erealloc(void *, size_t);
185extern char *estrdup(const char *);
186extern void failed(struct cfjail *j);
187extern void jail_note(const struct cfjail *j, const char *fmt, ...);
188extern void jail_warnx(const struct cfjail *j, const char *fmt, ...);
189
190extern int run_command(struct cfjail *j, enum intparam comparam);
191extern int finish_command(struct cfjail *j);
192extern struct cfjail *next_proc(int nonblock);
193
194extern void load_config(void);
195extern struct cfjail *add_jail(void);
196extern void add_param(struct cfjail *j, const struct cfparam *p,
197 enum intparam ipnum, const char *value);
198extern int bool_param(const struct cfparam *p);
--- 26 unchanged lines hidden ---
2 * Copyright (c) 2010 James Gritton.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: projects/jailconf/usr.sbin/jail/jailp.h 223188 2011-06-17 16:06:13Z jamie $
27 */
28
29#include <sys/param.h>
30#include <sys/types.h>
31#include <sys/jail.h>
32#include <sys/queue.h>
33#include <sys/time.h>
34
--- 19 unchanged lines hidden (view full) ---
54#define JF_START 0x0001 /* -c */
55#define JF_SET 0x0002 /* -m */
56#define JF_STOP 0x0004 /* -r */
57#define JF_DEPEND 0x0008 /* Operation required by dependency */
58#define JF_WILD 0x0010 /* Not specified on the command line */
59#define JF_FAILED 0x0020 /* Operation failed */
60#define JF_PARAMS 0x0040 /* Parameters checked and imported */
61#define JF_RDTUN 0x0080 /* Create-only parameter check has been done */
62#define JF_IFUP 0x0100 /* IP addresses have been configured */
63#define JF_MOUNTED 0x0200 /* Filesystems have been mounted */
64#define JF_PERSIST 0x0400 /* Jail is temporarily persistent */
65#define JF_TIMEOUT 0x0800 /* A command (or process kill) timed out */
66#define JF_SLEEPQ 0x2000 /* Waiting on a command and/or timeout */
67
68#define JF_OP_MASK (JF_START | JF_SET | JF_STOP)
69#define JF_RESTART (JF_START | JF_STOP)
70#define JF_START_SET (JF_START | JF_SET)
71#define JF_SET_RESTART (JF_SET | JF_STOP)
72#define JF_START_SET_RESTART (JF_START | JF_SET | JF_STOP)
73#define JF_DO_STOP(js) (((js) & (JF_SET | JF_STOP)) == JF_STOP)
74
--- 22 unchanged lines hidden (view full) ---
97 IP_MOUNT_FSTAB, /* A standard fstab(5) file */
98 IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */
99 IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */
100 IP__IP4_IFADDR, /* Copy of ip4.addr with interface/netmask */
101#ifdef INET6
102 IP__IP6_IFADDR, /* Copy of ip6.addr with interface/prefixlen */
103#endif
104 IP__MOUNT_FROM_FSTAB, /* Line from mount.fstab file */
105 KP_ALLOW_CHFLAGS,
106 KP_ALLOW_MOUNT,
107 KP_ALLOW_RAW_SOCKETS,
108 KP_ALLOW_SET_HOSTNAME,
109 KP_ALLOW_SOCKET_AF,
110 KP_ALLOW_SYSVIPC,
111 KP_ENFORCE_STATFS,
112 KP_HOST_HOSTNAME,
--- 46 unchanged lines hidden (view full) ---
159 char *comline;
160 struct cfparams params;
161 struct cfdepends dep[2];
162 struct cfjails *queue;
163 struct cfparam *intparams[IP_NPARAM];
164 struct cfstring *comstring;
165 struct jailparam *jp;
166 struct timespec timeout;
167 enum intparam comparam;
168 unsigned flags;
169 int jid;
170 int seq;
171 int pstatus;
172 int ndeps;
173 int njp;
174 int nprocs;
175};
--- 6 unchanged lines hidden (view full) ---
182
183extern void *emalloc(size_t);
184extern void *erealloc(void *, size_t);
185extern char *estrdup(const char *);
186extern void failed(struct cfjail *j);
187extern void jail_note(const struct cfjail *j, const char *fmt, ...);
188extern void jail_warnx(const struct cfjail *j, const char *fmt, ...);
189
190extern int run_command(struct cfjail *j, enum intparam comparam);
191extern int finish_command(struct cfjail *j);
192extern struct cfjail *next_proc(int nonblock);
193
194extern void load_config(void);
195extern struct cfjail *add_jail(void);
196extern void add_param(struct cfjail *j, const struct cfparam *p,
197 enum intparam ipnum, const char *value);
198extern int bool_param(const struct cfparam *p);
--- 26 unchanged lines hidden ---