diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/jail/command.c | 4 | ||||
-rw-r--r-- | usr.sbin/jail/jail.c | 7 | ||||
-rw-r--r-- | usr.sbin/jail/jailp.h | 1 |
3 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index b749576..b7d5168 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -246,7 +246,7 @@ next_proc(int nonblock) /* * Run a single command for a jail, possible inside the jail. */ -int +static int run_command(struct cfjail *j) { const struct passwd *pwd; @@ -290,6 +290,8 @@ run_command(struct cfjail *j) } else { if (create_jail(j) < 0) return -1; + if (iflag) + printf("%d\n", j->jid); if (verbose >= 0 && (j->name || verbose > 0)) jail_note(j, "created\n"); dep_done(j, DF_LIGHT); diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index e827e11..4fc03c9 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -55,6 +55,7 @@ struct permspec { }; const char *cfname; +int iflag; int note_remove; int verbose; @@ -129,7 +130,7 @@ main(int argc, char **argv) size_t sysvallen; unsigned op, pi; int ch, docf, error, i, oldcl, sysval; - int dflag, iflag, Rflag; + int dflag, Rflag; char enforce_statfs[4]; #if defined(INET) || defined(INET6) char *cs, *ncs; @@ -139,7 +140,7 @@ main(int argc, char **argv) #endif op = 0; - dflag = iflag = Rflag = 0; + dflag = Rflag = 0; docf = 1; cfname = CONF_FILE; JidFile = NULL; @@ -415,8 +416,6 @@ main(int argc, char **argv) continue; jail_create_done: clear_persist(j); - if (iflag) - printf("%d\n", j->jid); if (jfp != NULL) print_jail(jfp, j, oldcl); dep_done(j, 0); diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index 31a2aba..ffd35cc 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -227,6 +227,7 @@ extern struct cfjails cfjails; extern struct cfjails ready; extern struct cfjails depend; extern const char *cfname; +extern int iflag; extern int note_remove; extern int paralimit; extern int verbose; |