From nobody Thu Dec 21 13:43:36 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 4Sws8T0NdRz54pXM; Thu, 21 Dec 2023 13:43:37 +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 4Sws8S5CP9z4NWP; Thu, 21 Dec 2023 13:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166216; 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=P6wKzjpgaoZdQgaHlqq06jRQyiHpW7dcw5qoj4FVtTA=; b=QWk2DG0oC2Yp5hzi/ckP/5oemQ62Hfk2jZ1FRX+Xf0zW50liKrx+LywqZQs+lWDn44IsvP /lDVayrq0c4FCbrlFOLFhN/QFxw2+FEh64UXXu6EIcHRQyke9l8M5baWVw+oSbrBhBoC3C XUP1UYsimMkYAaICRdG49UAiFa7gUwdlVxnIC6cJjq357CWbF0AvbamGxheoinU4b/ahXI ahh4bGSO/0he8cWdlWpAib7HmFgPUh0IWOTQFpo/5N9irriLIT6/QUyqLbfJ9/OMxJNpVw H/TX6kSIvNfHotZEFmqN9TuhEnakEgyPcSPLUVDgOqvu3GnVYVDMWjdkDJjKAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166216; a=rsa-sha256; cv=none; b=uRE8mqsAMbMeW2zcSEjfkMYM95w/wTg2grDbKcyeIpR2nMLLyCwTHzy4dayhak6+dvXDWw BMkKOdS/87vdQcO2Nxg2hCSkO2lFTgo3nBt2Add++ykEZalAoOwF47Fy1JDe4kXksFPxKP VyAVxqlFOJUGQSH5/HMHeeOfNE0tTnfhnreNUoNfCE5FAlHnZivpVg9br3eTrEnQdyuU3A q6iRKTk+utHkt3Y+FtD61GzXQROUCITtyGEKAApK4civeBjv9ndCQP8stt6u5yhlODexqd dm2VgdALoSOyUlgyJ8Nlplz4fhKu3o2yZqYdLVEElLS7smj74WfYky/BWjWyYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166216; 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=P6wKzjpgaoZdQgaHlqq06jRQyiHpW7dcw5qoj4FVtTA=; b=b5E3zW99eWCNnS/4HK++HlhKcyrcVw/ETi3MrKS+5OP1CbgVz4ySzK2+Xkh/JN27eP9u9I PHYM0Doj4uzl7cayNrgn6r+54gHKVS1ITbxQc2/TIKgRZk+f8WQzBCqTA/vDrZF6Bx/gsn YoOZQ2uKIatXWupPklxaqyL2bQF/ikMBRPhiPHYet2F6QaVm5nB3jsAsK0AIPw0Me2Kuvy jgdQCtrA0ZX2IAz4fSXDUYfm+VDnHJB4HHMz8GdLo9N7q3h7f63/UZwt6ItPfJ8zQcS48s a7alV00CFMPhl5Sjq12P9yrtxpVCp55r2UMGwV3Tqzjcbx5xv5hhWahRlNnPKg== 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 4Sws8S4KVVzZmM; Thu, 21 Dec 2023 13:43:36 +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 3BLDha30079125; Thu, 21 Dec 2023 13:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhak8079122; Thu, 21 Dec 2023 13:43:36 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:36 GMT Message-Id: <202312211343.3BLDhak8079122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 865df3aed731 - stable/13 - prison_check(9): Bring up-to-date with hierarchical jails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 865df3aed73197f00967fed573fc9fa7b74df08d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=865df3aed73197f00967fed573fc9fa7b74df08d commit 865df3aed73197f00967fed573fc9fa7b74df08d Author: Olivier Certner AuthorDate: 2023-08-17 23:54:44 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:38 +0000 prison_check(9): Bring up-to-date with hierarchical jails Reviewed by: bcr, emaste, pauamma_gundo.com, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40639 (cherry picked from commit e9fdd494537ca45b14e0917e8bb1595b6460f3a3) Approved by: markj (mentor) --- share/man/man9/prison_check.9 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/share/man/man9/prison_check.9 b/share/man/man9/prison_check.9 index b3bdcf6b4571..7f174e3ceb2e 100644 --- a/share/man/man9/prison_check.9 +++ b/share/man/man9/prison_check.9 @@ -25,22 +25,23 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 11, 2003 +.Dd August 18, 2023 .Dt PRISON_CHECK 9 .Os .Sh NAME .Nm prison_check -.Nd determine if two credentials belong to the same jail +.Nd determine if subjects may see entities according to jail restrictions .Sh SYNOPSIS .In sys/jail.h .Ft int .Fn prison_check "struct ucred *cred1" "struct ucred *cred2" .Sh DESCRIPTION -This function can be used to determine if the two credentials +This function determines if a subject with credentials .Fa cred1 -and +is denied access to subjects or objects with credentials .Fa cred2 -belong to the same jail. +according to the policy that a subject can see subjects or objects in its own +jail or any sub-jail of it. .Sh RETURN VALUES The .Fn prison_check @@ -48,12 +49,9 @@ function returns .Er ESRCH if -.Fa cred1 -has been jailed, and -.Fa cred1 -and .Fa cred2 -do not belong to the same jail. +is not in the same jail or a sub-jail of that of +.Fa cred1 . In all other cases, .Fn prison_check returns zero.