svn commit: r348862 - stable/12/sbin/bectl

Kyle Evans kevans at FreeBSD.org
Mon Jun 10 14:35:05 UTC 2019


Author: kevans
Date: Mon Jun 10 14:35:04 2019
New Revision: 348862
URL: https://svnweb.freebsd.org/changeset/base/348862

Log:
  MFC r348510: bectl(8): Don't accept jid=0 from jail_getid
  
  This will trivially exist, but we don't want it - none of our jailed BEs
  will have jid=0.

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	Mon Jun 10 14:31:18 2019	(r348861)
+++ stable/12/sbin/bectl/bectl_jail.c	Mon Jun 10 14:35:04 2019	(r348862)
@@ -410,7 +410,12 @@ bectl_locate_jail(const char *ident)
 
 	/* Try the easy-match first */
 	jid = jail_getid(ident);
-	if (jid != -1)
+	/*
+	 * jail_getid(0) will always return 0, because this prison does exist.
+	 * bectl(8) knows that this is not what it wants, so we should fall
+	 * back to mount point search.
+	 */
+	if (jid > 0)
 		return (jid);
 
 	/* Attempt to try it as a BE name, first */


More information about the svn-src-all mailing list