Date: Mon, 10 Jun 2019 14:47:56 +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-11@freebsd.org Subject: svn commit: r348863 - stable/11/sbin/bectl Message-ID: <201906101447.x5AElub3066260@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Mon Jun 10 14:47:56 2019 New Revision: 348863 URL: https://svnweb.freebsd.org/changeset/base/348863 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. Approved by: re (gjb) Modified: stable/11/sbin/bectl/bectl_jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/bectl/bectl_jail.c ============================================================================== --- stable/11/sbin/bectl/bectl_jail.c Mon Jun 10 14:35:04 2019 (r348862) +++ stable/11/sbin/bectl/bectl_jail.c Mon Jun 10 14:47:56 2019 (r348863) @@ -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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906101447.x5AElub3066260>