1 .\" Copyright (c) 2001 Networks Associates Technology, Inc.
2 .\" All rights reserved.
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
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
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 .\" 3. The name of the author may not be used to endorse or promote
19 .\" products derived from this software without specific prior written
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 .Nd convert MAC label to/from text representation
46 .Fn mac_from_text "const char *text_p"
48 .Fn mac_to_text "mac_t label" "size_t *len_p"
52 function converts the text representation of a label
55 which must later be freed with
60 the text representation of
64 to the length of the returned string.
67 uses the following format
68 for MAC policy text representations:
70 .Dl Sy policy Ns No / Ns Sy qualifier
80 Valid labels can have the following arguments for
82 depending on the value of
84 .Bl -tag -width "Policy" -offset indent
100 consist of a type name which must
101 neither be empty nor exceed the length limit for the label.
104 All policies must be present
105 in a comma-separated list,
106 but may be in any order
112 function returns a valid
115 the MAC label described in
119 upon failure, setting
121 to indicate the error.
125 function returns a string
126 containing the text representation of
130 upon failure, setting
132 to indicate the error.
134 The following are valid MAC labels:
135 .Bd -literal -offset indent
136 biba/high,mls/low,te/none
137 biba/low,mls/low,te/none
138 biba/low,mls/3,te/none
141 POSIX.1e does not define
142 a text format for text representations
147 An invalid policy or qualifier
150 or an invalid MAC label
154 Insufficient memory was available
155 to allocate internal storage.
163 POSIX.1e is described in IEEE POSIX.1e draft 17.
164 Discussion of the draft
165 continues on the cross-platform POSIX.1e implementation mailing list.
166 To join this list, see the
168 POSIX.1e implementation page
169 for more information.