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 --- 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: projects/jailconf/usr.sbin/jail/state.c 223188 2011-06-17 16:06:13Z jamie $"); |
29 30#include <sys/uio.h> 31 32#include <err.h> 33#include <stdlib.h> 34#include <string.h> 35 36#include "jailp.h" --- 27 unchanged lines hidden (view full) --- 64 65 if (!docf) { 66 /* 67 * With no config file, let "depend" for a single jail 68 * look at currently running jails. 69 */ 70 if ((j = TAILQ_FIRST(&cfjails)) && 71 (p = j->intparams[IP_DEPEND])) { |
72 TAILQ_FOREACH(s, &p->val, tq) { |
73 if (running_jid(s->s, 0) < 0) { 74 warnx("depends on nonexistent jail " 75 "\"%s\"", s->s); 76 j->flags |= JF_FAILED; 77 } 78 } 79 } 80 return; --- 11 unchanged lines hidden (view full) --- 92 deps = 0; 93 ldeps = 0; 94 plen = 0; 95 pname = NULL; 96 TAILQ_FOREACH(j, &cfjails, tq) { 97 if (j->flags & JF_FAILED) 98 continue; 99 if ((p = j->intparams[IP_DEPEND])) { |
100 TAILQ_FOREACH(s, &p->val, tq) { |
101 dj = find_jail(s->s); 102 if (dj != NULL) { 103 deps++; 104 dep_add(j, dj, 0); 105 } else { 106 jail_warnx(j, 107 "depends on undefined jail \"%s\"", 108 s->s); --- 358 unchanged lines hidden --- |