xref: /freebsd/lib/libc/posix1e/mac_is_present.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1d97fcfceSRobert Watson.\" Copyright (c) 2002 Networks Associates Technology, Inc.
2d97fcfceSRobert Watson.\" All rights reserved.
3d97fcfceSRobert Watson.\"
4d97fcfceSRobert Watson.\" This software was developed for the FreeBSD Project by Chris
5d97fcfceSRobert Watson.\" Costello at Safeport Network Services and NAI Labs, the Security
6d97fcfceSRobert Watson.\" Research Division of Network Associates, Inc. under DARPA/SPAWAR
7d97fcfceSRobert Watson.\" contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
8d97fcfceSRobert Watson.\" research program.
9d97fcfceSRobert Watson.\"
10d97fcfceSRobert Watson.\" Redistribution and use in source and binary forms, with or without
11d97fcfceSRobert Watson.\" modification, are permitted provided that the following conditions
12d97fcfceSRobert Watson.\" are met:
13d97fcfceSRobert Watson.\" 1. Redistributions of source code must retain the above copyright
14d97fcfceSRobert Watson.\"    notice, this list of conditions and the following disclaimer.
15d97fcfceSRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
16d97fcfceSRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
17d97fcfceSRobert Watson.\"    documentation and/or other materials provided with the distribution.
18d97fcfceSRobert Watson.\"
19d97fcfceSRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20d97fcfceSRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21d97fcfceSRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22d97fcfceSRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23d97fcfceSRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24d97fcfceSRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25d97fcfceSRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26d97fcfceSRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27d97fcfceSRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28d97fcfceSRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29d97fcfceSRobert Watson.\" SUCH DAMAGE.
30d97fcfceSRobert Watson.\"
31ad136d1eSRuslan Ermilov.Dd July 7, 2006
32ad136d1eSRuslan Ermilov.Dt MAC_IS_PRESENT 3
33051bb54bSRuslan Ermilov.Os
34d97fcfceSRobert Watson.Sh NAME
351e5294bcSRobert Watson.Nm mac_is_present
36d97fcfceSRobert Watson.Nd report whether the running system has MAC support
373b296920SRuslan Ermilov.Sh LIBRARY
383b296920SRuslan Ermilov.Lb libc
39d97fcfceSRobert Watson.Sh SYNOPSIS
40d97fcfceSRobert Watson.In sys/mac.h
41d97fcfceSRobert Watson.Ft int
42d97fcfceSRobert Watson.Fn mac_is_present "const char *policyname"
43d97fcfceSRobert Watson.Sh DESCRIPTION
44d97fcfceSRobert WatsonThe
451e5294bcSRobert Watson.Fn mac_is_present
46d97fcfceSRobert Watsonfunction determines whether the currently-running kernel supports MAC for
47d97fcfceSRobert Watsona given policy or not.
48d97fcfceSRobert WatsonIf
49d97fcfceSRobert Watson.Fa policyname
503b296920SRuslan Ermilovis
51ad136d1eSRuslan Ermilov.Pf non- Dv NULL ,
52d97fcfceSRobert Watsonthe presence of the named policy
533b296920SRuslan Ermilov(e.g.\&
543b296920SRuslan Ermilov.Dq Li biba ,
553b296920SRuslan Ermilov.Dq Li mls ,
563b296920SRuslan Ermilov.Dq Li te )
57d97fcfceSRobert Watsonis checked, otherwise the presence of any MAC policies at all is checked.
58d97fcfceSRobert Watson.Sh RETURN VALUES
59d97fcfceSRobert WatsonIf the system supports the given MAC policy, the value 1 is returned.
60d97fcfceSRobert WatsonIf the specified MAC policy is not supported, the value 0 is returned.
613b296920SRuslan ErmilovIf an error occurs, the value \-1 is returned.
62d97fcfceSRobert Watson.Sh ERRORS
63d97fcfceSRobert Watson.Bl -tag -width Er
64d97fcfceSRobert Watson.It Bq Er EINVAL
65d97fcfceSRobert WatsonThe value of
66d97fcfceSRobert Watson.Fa policyname
67d97fcfceSRobert Watsonis not valid.
68d97fcfceSRobert Watson.It Bq Er ENOMEM
69d97fcfceSRobert WatsonInsufficient memory was available to allocate internal storage.
70d97fcfceSRobert Watson.El
71d97fcfceSRobert Watson.Sh SEE ALSO
7276a829fdSChris Costello.Xr mac 3 ,
7376a829fdSChris Costello.Xr mac_free 3 ,
7476a829fdSChris Costello.Xr mac_get 3 ,
7576a829fdSChris Costello.Xr mac_prepare 3 ,
7676a829fdSChris Costello.Xr mac_set 3 ,
7776a829fdSChris Costello.Xr mac_text 3 ,
788f8690e7SChris Costello.Xr mac 4 ,
7976a829fdSChris Costello.Xr mac 9
8009a7f448SRobert Watson.Sh HISTORY
8109a7f448SRobert WatsonSupport for Mandatory Access Control was introduced in
8209a7f448SRobert Watson.Fx 5.0
8309a7f448SRobert Watsonas part of the
8409a7f448SRobert Watson.Tn TrustedBSD
8509a7f448SRobert WatsonProject.
86