1/*-
2 * Copyright (c) 2011 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
--- 11 unchanged lines hidden (view full) ---
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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/10/usr.sbin/jail/command.c 276277 2014-12-27 02:17:35Z jamie $");
29
30#include <sys/types.h>
31#include <sys/event.h>
32#include <sys/mount.h>
33#include <sys/stat.h>
34#include <sys/sysctl.h>
35#include <sys/user.h>
36#include <sys/wait.h>
--- 70 unchanged lines hidden (view full) ---
107 if (!bool_param(j->intparams[IP_MOUNT_DEVFS]))
108 continue;
109 j->comstring = &dummystring;
110 break;
111 case IP_MOUNT_FDESCFS:
112 if (!bool_param(j->intparams[IP_MOUNT_FDESCFS]))
113 continue;
114 j->comstring = &dummystring;
115 case IP__OP:
116 case IP_STOP_TIMEOUT:
117 j->comstring = &dummystring;
118 break;
119 default:
120 if (j->intparams[comparam] == NULL)
121 continue;
122 j->comstring = create_failed || (stopping &&
--- 401 unchanged lines hidden (view full) ---
524 *(const char **)&argv[1] = "-t";
525 *(const char **)&argv[2] = "fdescfs";
526 *(const char **)&argv[3] = ".";
527 argv[4] = devpath;
528 argv[5] = NULL;
529 }
530 break;
531
532 case IP_COMMAND:
533 if (j->name != NULL)
534 goto default_command;
535 argc = 0;
536 TAILQ_FOREACH(s, &j->intparams[IP_COMMAND]->val, tq)
537 argc++;
538 argv = alloca((argc + 1) * sizeof(char *));
539 argc = 0;
--- 409 unchanged lines hidden ---
2 * Copyright (c) 2011 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
--- 11 unchanged lines hidden (view full) ---
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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/10/usr.sbin/jail/command.c 276277 2014-12-27 02:17:35Z jamie $");
29
30#include <sys/types.h>
31#include <sys/event.h>
32#include <sys/mount.h>
33#include <sys/stat.h>
34#include <sys/sysctl.h>
35#include <sys/user.h>
36#include <sys/wait.h>
--- 70 unchanged lines hidden (view full) ---
107 if (!bool_param(j->intparams[IP_MOUNT_DEVFS]))
108 continue;
109 j->comstring = &dummystring;
110 break;
111 case IP_MOUNT_FDESCFS:
112 if (!bool_param(j->intparams[IP_MOUNT_FDESCFS]))
113 continue;
114 j->comstring = &dummystring;
115 case IP__OP:
116 case IP_STOP_TIMEOUT:
117 j->comstring = &dummystring;
118 break;
119 default:
120 if (j->intparams[comparam] == NULL)
121 continue;
122 j->comstring = create_failed || (stopping &&
--- 401 unchanged lines hidden (view full) ---
524 *(const char **)&argv[1] = "-t";
525 *(const char **)&argv[2] = "fdescfs";
526 *(const char **)&argv[3] = ".";
527 argv[4] = devpath;
528 argv[5] = NULL;
529 }
530 break;
531
532 case IP_COMMAND:
533 if (j->name != NULL)
534 goto default_command;
535 argc = 0;
536 TAILQ_FOREACH(s, &j->intparams[IP_COMMAND]->val, tq)
537 argc++;
538 argv = alloca((argc + 1) * sizeof(char *));
539 argc = 0;
--- 409 unchanged lines hidden ---