Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 2020 21:53:55 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368682 - stable/12/sbin/bectl
Message-ID:  <202012152153.0BFLrtxN053239@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Dec 15 21:53:54 2020
New Revision: 368682
URL: https://svnweb.freebsd.org/changeset/base/368682

Log:
  MFC r368388: bectl: simplify the tail end of the jail cmd
  
  This has already confused me once (and I'm pretty sure I wrote it), so let's
  clarify: unjailing after the command has completed will only happen if we're
  interactive and -U has not been specified.
  
  This just folds two conditionals together to make it obvious how -b/-U
  interact with each other.

Modified:
  stable/12/sbin/bectl/bectl_jail.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/bectl/bectl_jail.c
==============================================================================
--- stable/12/sbin/bectl/bectl_jail.c	Tue Dec 15 21:53:15 2020	(r368681)
+++ stable/12/sbin/bectl/bectl_jail.c	Tue Dec 15 21:53:54 2020	(r368682)
@@ -356,10 +356,8 @@ bectl_cmd_jail(int argc, char *argv[])
 	}
 	free(jargv);
 
-	if (!interactive)
-		return (0);
-
-	if (unjail) {
+	/* Non-interactive (-b) mode means the jail sticks around. */
+	if (interactive && unjail) {
 		/*
 		 *  We're not checking the jail id result here because in the
 		 *  case of invalid param, or last command in jail was an error



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012152153.0BFLrtxN053239>