xref: /freebsd/lib/libc/posix1e/mac_text.3 (revision 7660b554bc59a07be0431c17e0e33815818baa69)
1.\" Copyright (c) 2001 Networks Associates Technology, Inc.
2.\" All rights reserved.
3.\"
4.\" This software was developed for the FreeBSD Project by Chris
5.\" Costello at Safeport Network Services and NAI Labs, the Security
6.\" Research Division of Network Associates, Inc. under DARPA/SPAWAR
7.\" contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
8.\" research program.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD$
32.\"
33.Dd December 21, 2001
34.Dt MAC_TEXT 3
35.Os
36.Sh NAME
37.Nm mac_from_text ,
38.Nm mac_to_text
39.Nd convert MAC label to/from text representation
40.Sh LIBRARY
41.Lb libc
42.Sh SYNOPSIS
43.In sys/mac.h
44.Ft int
45.Fn mac_from_text "mac_t *mac" "const char *text"
46.Ft int
47.Fn mac_to_text "mac_t label" "char **text"
48.Sh DESCRIPTION
49The
50.Fn mac_from_text
51function converts the text representation of a label
52into the internal policy label format
53.Pq Vt mac_t
54and places it in
55.Fa *mac ,
56which must later be freed with
57.Xr mac_free 3 .
58.Pp
59The
60.Fn mac_to_text
61function allocates storage for
62.Fa *text ,
63which will be set to the text representation of
64.Fa label .
65.Pp
66Refer to
67.Xr maclabel 7
68for the MAC label format.
69.Sh RETURN VALUES
70.Rv -std mac_from_text mac_to_text
71.Sh COMPATIBILITY
72POSIX.1e does not define
73a format for text representations
74of MAC labels.
75.Sh ERRORS
76.Bl -tag -width Er
77.It Bq Er ENOMEM
78Insufficient memory was available
79to allocate internal storage.
80.El
81.Sh SEE ALSO
82.Xr mac 3 ,
83.Xr mac_free 3 ,
84.Xr mac_get 3 ,
85.Xr mac_is_present_np 3 ,
86.Xr mac_prepare 3 ,
87.Xr mac_set 3 ,
88.Xr mac 4 ,
89.Xr maclabel 7
90.Sh STANDARDS
91POSIX.1e is described in IEEE POSIX.1e draft 17.
92Discussion of the draft
93continues on the cross-platform POSIX.1e implementation mailing list.
94To join this list, see the
95.Fx
96POSIX.1e implementation page
97for more information.
98.Sh HISTORY
99Support for Mandatory Access Control was introduced in
100.Fx 5.0
101as part of the
102.Tn TrustedBSD
103Project.
104