xref: /freebsd/share/man/man9/securelevel_gt.9 (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1.\"
2.\" Copyright (c) 2000 Christian S.J. Peron <maneo@bsdpro.com>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. The name of the author may not be used to endorse or promote products
14.\"    derived from this software without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\" $FreeBSD$
28.\"
29.Dd June 2, 2007
30.Dt SECURELEVEL_GT 9
31.Os
32.Sh NAME
33.Nm securelevel_gt , securelevel_ge
34.Nd test active securelevel
35.Sh SYNOPSIS
36.In sys/types.h
37.In sys/proc.h
38.Ft int
39.Fn securelevel_gt "struct ucred *cr" "int level"
40.Ft int
41.Fn securelevel_ge "struct ucred *cr" "int level"
42.Sh DESCRIPTION
43These functions test the active security level against the given
44.Fa level .
45If the calling credential
46.Fa cr
47was imprisoned by the
48.Xr jail 2
49system call, and has a
50different security level set than the host environment,
51the security level with the highest value is used.
52.Pp
53The
54.Fn securelevel_gt
55function
56will evaluate whether or not the active security
57level is greater than the supplied
58.Fa level .
59.Pp
60The
61.Fn securelevel_ge
62function
63will evaluate whether or not the active security
64level is greater than or equal to the supplied
65.Fa level .
66.Sh RETURN VALUES
67These functions return
68.Er EPERM
69if condition evaluated to true, and 0 otherwise.
70.Sh SEE ALSO
71.Xr securelevel 7
72