From nobody Sat Nov 18 20:48:19 2023
X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SXm7m0nq3z51c3d;
	Sat, 18 Nov 2023 20:48:20 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4SXm7m0HPwz4XW8;
	Sat, 18 Nov 2023 20:48:20 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1700340500;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=S9QlGIZZ3HW6k5pwBkIvVGtAZnmK00Vq+k24QhVlMpI=;
	b=nrHVK64jCspQRHHVwVr8EDXfw6ZUoIuoH4sTUkawljTJ+LYaBXfqm90YqlfaQ3swGAzPnO
	LLSpymPcnB4xAP09kY5VTS59oLkal3gQozIuEmuH668irEQy1SOTa9IuEmnITPedq5MQ77
	I1UPemIJGh/M0zmuZPGd/N0XMlTAyfTii061Ufs6u3A0jeQcG0ZtEB/uni9jsKGp/y1RJO
	ms61Lf9CNYerfgBL4H6LklMN44RargEh4WRum05EGykgmyp7W097Tm6ZwoI81MHSqren6G
	8v5BaoIlVXmqIkVKSgoO1VmTrHgdu1YcjDSkIP1FWu4uYK7C5avm9X8sfRzAXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1700340500;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=S9QlGIZZ3HW6k5pwBkIvVGtAZnmK00Vq+k24QhVlMpI=;
	b=rvRTx6JUgI7eFYuuUKPs799jnXqRKsFQBQOKbU8YU0WotyFHj/wc/wu0/QLbvMLxhqXVyo
	tCRShv6N0H7CyS5ZdtjpCcfaVczmDfqhvf1KEKMMre9AghdNdtKdBgsyLPsb1YwOsd/qL/
	0JrmlrkghmTeEH+NM6Fesb3anSFi/V1C9r/DemVlYuWFIQWFo13GL35IBRIt32XqAlrddZ
	zc2fJWHub3iI3AErlDjhzsNpbNcrVrJfY1Tm5Tf9HvHNJWBCzQUbneCIJ6PxQxo5/ksdW7
	2iSC7MuP7VlxSk6hRoQSC6mTp9KGJvSUAzjIvl3c9thvQ3BRxN9jvPXziJsW2w==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700340500; a=rsa-sha256; cv=none;
	b=Q0ZHD6ViraKSceR/xOVWp+huPmpM2ZWwD3v3vMc5+4fy1LrEqfMjLHEX3zWh9M/O9Vdxg3
	dNBDpkaY8oD7NqZMhFTqZVXWed/0Zm65MJ0YCYaA+41jZOQJqkO/RFG2ou744vf/0rB9Zw
	xzA/VJqdUBBjRGT+Sj81F3+CZOW6r/DqKbntq0L0tOlc50F5q+OAJm1RzhSIXBYAl3QmOq
	U8idjTkgbbVOT0MCVwomMHwXbaNfQGSJJ6diU9JXdR0vOEsKREBpeOAb0OmXekvZg/+ap9
	mGgC4C+6dmEvtrR6VCgdYUc2uytselqbK576hu/I6JEcRxLwUbFEPKlkTONJuA==
Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SXm7l6SMpzhWR;
	Sat, 18 Nov 2023 20:48:19 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
	by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AIKmJb3051286;
	Sat, 18 Nov 2023 20:48:19 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AIKmJGq051283;
	Sat, 18 Nov 2023 20:48:19 GMT
	(envelope-from git)
Date: Sat, 18 Nov 2023 20:48:19 GMT
Message-Id: <202311182048.3AIKmJGq051283@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-main@FreeBSD.org
From: Jamie Gritton <jamie@FreeBSD.org>
Subject: git: 6000d46fc3c1 - main - Move "jail -e" out of the rest
  of jail(8) flow.
List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all
List-Help: <mailto:dev-commits-src-all+help@freebsd.org>
List-Post: <mailto:dev-commits-src-all@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-all+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-all+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-all@freebsd.org
X-BeenThere: dev-commits-src-all@freebsd.org
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: jamie
X-Git-Repository: src
X-Git-Refname: refs/heads/main
X-Git-Reftype: branch
X-Git-Commit: 6000d46fc3c18c72bd09f7f4134c7293b62f3416
Auto-Submitted: auto-generated

The branch main has been updated by jamie:

URL: https://cgit.FreeBSD.org/src/commit/?id=6000d46fc3c18c72bd09f7f4134c7293b62f3416

commit 6000d46fc3c18c72bd09f7f4134c7293b62f3416
Author:     Jamie Gritton <jamie@FreeBSD.org>
AuthorDate: 2023-11-18 20:47:50 +0000
Commit:     Jamie Gritton <jamie@FreeBSD.org>
CommitDate: 2023-11-18 20:47:50 +0000

    Move "jail -e" out of the rest of jail(8) flow.
---
 usr.sbin/jail/jail.c  | 25 ++++++++++++++-----------
 usr.sbin/jail/jailp.h |  1 -
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c
index 9e443c9f3f1d..fcff0d485682 100644
--- a/usr.sbin/jail/jail.c
+++ b/usr.sbin/jail/jail.c
@@ -139,7 +139,7 @@ main(int argc, char **argv)
 	size_t sysvallen;
 	unsigned op, pi;
 	int ch, docf, error, i, oldcl, sysval;
-	int dflag, Rflag;
+	int dflag, eflag, Rflag;
 #if defined(INET) || defined(INET6)
 	char *cs, *ncs;
 #endif
@@ -148,7 +148,7 @@ main(int argc, char **argv)
 #endif
 
 	op = 0;
-	dflag = Rflag = 0;
+	dflag = eflag = Rflag = 0;
 	docf = 1;
 	cfname = CONF_FILE;
 	JidFile = NULL;
@@ -162,7 +162,7 @@ main(int argc, char **argv)
 			dflag = 1;
 			break;
 		case 'e':
-			op |= JF_SHOW;
+			eflag = 1;
 			separator = optarg;
 			break;
 		case 'f':
@@ -232,7 +232,16 @@ main(int argc, char **argv)
 	argc -= optind;
 	argv += optind;
 
-	/* Find out which of the four command line styles this is. */
+	if (eflag) {
+		/* Just print list of all configured non-wildcard jails */
+		if (op || argc > 0)
+			usage();
+		load_config(cfname);
+		show_jails();
+		exit(0);
+	}
+
+	/* Find out which of the command line styles this is. */
 	oldcl = 0;
 	if (!op) {
 		/* Old-style command line with four fixed parameters */
@@ -282,13 +291,7 @@ main(int argc, char **argv)
 					    ? NULL : "false");
 			}
 		}
-	} else if (op == JF_STOP || op == JF_SHOW) {
-		/* Just print list of all configured non-wildcard jails */
-		if (op == JF_SHOW) {
-			load_config(cfname);
-			show_jails();
-			exit(0);
-		}
+	} else if (op == JF_STOP) {
 		/* Jail remove, perhaps using the config file */
 		if (!docf || argc == 0)
 			usage();
diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h
index f371a92b82ec..c064da09d7a5 100644
--- a/usr.sbin/jail/jailp.h
+++ b/usr.sbin/jail/jailp.h
@@ -67,7 +67,6 @@
 #define JF_TIMEOUT	0x0200	/* A command (or process kill) timed out */
 #define JF_SLEEPQ	0x0400	/* Waiting on a command and/or timeout */
 #define JF_FROM_RUNQ	0x0800	/* Has already been on the run queue */
-#define JF_SHOW		0x1000	/* -e Exhibit list of configured jails */
 
 #define JF_OP_MASK		(JF_START | JF_SET | JF_STOP)
 #define JF_RESTART		(JF_START | JF_STOP)