xref: /freebsd/share/man/man9/prison_check.9 (revision e9fdd494537ca45b14e0917e8bb1595b6460f3a3)
1f096643bSJoseph Koshy.\"
262486687SUlrich Spörlein.\" Copyright (c) 2003 Joseph Koshy <jkoshy@FreeBSD.org>
3f096643bSJoseph Koshy.\"
4f096643bSJoseph Koshy.\" All rights reserved.
5f096643bSJoseph Koshy.\"
6f096643bSJoseph Koshy.\" This program is free software.
7f096643bSJoseph Koshy.\"
8f096643bSJoseph Koshy.\" Redistribution and use in source and binary forms, with or without
9f096643bSJoseph Koshy.\" modification, are permitted provided that the following conditions
10f096643bSJoseph Koshy.\" are met:
11f096643bSJoseph Koshy.\" 1. Redistributions of source code must retain the above copyright
12f096643bSJoseph Koshy.\"    notice, this list of conditions and the following disclaimer.
13f096643bSJoseph Koshy.\" 2. Redistributions in binary form must reproduce the above copyright
14f096643bSJoseph Koshy.\"    notice, this list of conditions and the following disclaimer in the
15f096643bSJoseph Koshy.\"    documentation and/or other materials provided with the distribution.
16f096643bSJoseph Koshy.\"
17f096643bSJoseph Koshy.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
18f096643bSJoseph Koshy.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19f096643bSJoseph Koshy.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20f096643bSJoseph Koshy.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21f096643bSJoseph Koshy.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22f096643bSJoseph Koshy.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23f096643bSJoseph Koshy.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24f096643bSJoseph Koshy.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25f096643bSJoseph Koshy.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26f096643bSJoseph Koshy.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27f096643bSJoseph Koshy.\"
28*e9fdd494SOlivier Certner.Dd August 18, 2023
29c8cbcbceSRuslan Ermilov.Dt PRISON_CHECK 9
30aa12cea2SUlrich Spörlein.Os
31f096643bSJoseph Koshy.Sh NAME
32f096643bSJoseph Koshy.Nm prison_check
33*e9fdd494SOlivier Certner.Nd determine if subjects may see entities according to jail restrictions
34f096643bSJoseph Koshy.Sh SYNOPSIS
35f096643bSJoseph Koshy.In sys/jail.h
36f096643bSJoseph Koshy.Ft int
37f096643bSJoseph Koshy.Fn prison_check "struct ucred *cred1" "struct ucred *cred2"
38f096643bSJoseph Koshy.Sh DESCRIPTION
39*e9fdd494SOlivier CertnerThis function determines if a subject with credentials
40f096643bSJoseph Koshy.Fa cred1
41*e9fdd494SOlivier Certneris denied access to subjects or objects with credentials
42f096643bSJoseph Koshy.Fa cred2
43*e9fdd494SOlivier Certneraccording to the policy that a subject can see subjects or objects in its own
44*e9fdd494SOlivier Certnerjail or any sub-jail of it.
45f096643bSJoseph Koshy.Sh RETURN VALUES
46c8cbcbceSRuslan ErmilovThe
47f096643bSJoseph Koshy.Fn prison_check
48c8cbcbceSRuslan Ermilovfunction
49f096643bSJoseph Koshyreturns
50f096643bSJoseph Koshy.Er ESRCH
51f096643bSJoseph Koshyif
52f096643bSJoseph Koshy.Fa cred2
53*e9fdd494SOlivier Certneris not in the same jail or a sub-jail of that of
54*e9fdd494SOlivier Certner.Fa cred1 .
55f096643bSJoseph KoshyIn all other cases,
56f096643bSJoseph Koshy.Fn prison_check
57f096643bSJoseph Koshyreturns zero.
58f096643bSJoseph Koshy.Sh SEE ALSO
59f096643bSJoseph Koshy.Xr jail 2
60