summaryrefslogtreecommitdiffstats
path: root/usr.sbin/jail/jail.c
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2011-06-22 21:18:37 +0000
committerjamie <jamie@FreeBSD.org>2011-06-22 21:18:37 +0000
commit416d58f50fc60475c5aa1691108b5280a7296d47 (patch)
tree197d5fe7266878074ad2ecf25d07a7510ef72f7e /usr.sbin/jail/jail.c
parent6c5b20bbbbdcec03a157cce051d6f9e9e56b2874 (diff)
downloadFreeBSD-src-416d58f50fc60475c5aa1691108b5280a7296d47.zip
FreeBSD-src-416d58f50fc60475c5aa1691108b5280a7296d47.tar.gz
Advance to the next command before running anything, so errors found in
finish_command can be processed properly. Call failed() once in next_command() instead of multiple times in run_command(). Continue processing commands when a no-wait operation (IP__OP or background command) succeeds.
Diffstat (limited to 'usr.sbin/jail/jail.c')
-rw-r--r--usr.sbin/jail/jail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c
index 0f5091e..15e4946 100644
--- a/usr.sbin/jail/jail.c
+++ b/usr.sbin/jail/jail.c
@@ -404,7 +404,8 @@ main(int argc, char **argv)
continue;
if (j->jid > 0)
goto jail_create_done;
- j->comparam = startcommands + 1;
+ j->comparam = startcommands;
+ j->comstring = NULL;
}
if (next_command(j))
continue;
@@ -447,7 +448,8 @@ main(int argc, char **argv)
j->name);
goto jail_remove_done;
}
- j->comparam = stopcommands + 1;
+ j->comparam = stopcommands;
+ j->comstring = NULL;
} else if ((j->flags & JF_FAILED) && j->jid > 0)
goto jail_remove_done;
if (next_command(j))
OpenPOWER on IntegriCloud