Merge branch 'less_closed'
[unleashed.git] / usr / src / man / man3tsol / bltocolor.3tsol
blob69f964e331487ca09cd4f16a1cdb8dec8c9f36a9
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH BLTOCOLOR 3TSOL "Jul 20, 2007"
7 .SH NAME
8 bltocolor, bltocolor_r \- get character-coded color name of label
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
13 .fi
15 .LP
16 .nf
17 #include <tsol/label.h>
19 \fBchar *\fR\fBbltocolor\fR(\fBconst m_label_t *\fR\fIlabel\fR);
20 .fi
22 .LP
23 .nf
24 \fBchar *\fR\fBbltocolor_r\fR(\fBconst m_label_t *\fR\fIlabel\fR, \fBconst int\fR \fIsize\fR,
25      \fBchar *\fR\fIcolor_name\fR);
26 .fi
28 .SH DESCRIPTION
29 .sp
30 .LP
31 The \fBbltocolor()\fR and \fBbltocolor_r()\fR functions get the character-coded
32 color name associated with the binary label \fIlabel\fR.
33 .sp
34 .LP
35 The calling process must have \fBPRIV_SYS_TRANS_LABEL\fR in its set of
36 effective privileges to get color names of labels that dominate the current
37 process's sensitivity label.
38 .SH RETURN VALUES
39 .sp
40 .LP
41 The \fBbltocolor()\fR function returns a pointer to a statically allocated
42 string that contains the character-coded color name specified for the
43 \fIlabel\fR or returns \fB(char *)0\fR if, for any reason, no character-coded
44 color name is available for this binary label.
45 .sp
46 .LP
47 The \fBbltocolor_r()\fR function returns a pointer to the \fIcolor_name\fR
48 string which contains the character-coded color name specified for the
49 \fIlabel\fR or returns \fB(char *)0\fR if, for any reason, no character-coded
50 color name is available for this binary label. \fIcolor_name\fR must provide
51 for a string of at least \fIsize\fR characters.
52 .SH FILES
53 .sp
54 .ne 2
55 .na
56 \fB\fB/etc/security/tsol/\fR\fBlabel_encodings\fR\fR
57 .ad
58 .sp .6
59 .RS 4n
60 The label encodings file contains the classification names, words, constraints,
61 and values for the defined labels of this system.
62 .RE
64 .SH ATTRIBUTES
65 .sp
66 .LP
67 See \fBattributes\fR(5) for descriptions of the following attributes:
68 .sp
70 .sp
71 .TS
72 box;
73 c | c
74 l | l .
75 ATTRIBUTE TYPE  ATTRIBUTE VALUE
77 Interface Stability     Obsolete
79 MT-Level        MT-Safe with exceptions
80 .TE
82 .sp
83 .LP
84 These functions are obsolete and retained for ease of porting. They might be
85 removed in a future Solaris Trusted Extensions release. Use the
86 \fBlabel_to_str\fR(3TSOL) function instead.
87 .sp
88 .LP
89 The \fBbltocolor()\fR function returns a pointer to a statically allocated
90 string. Subsequent calls to it will overwrite that string with a new
91 character-coded color name. It is not MT-Safe. The \fBbltocolor_r()\fR function
92 should be used in multithreaded applications.
93 .SH SEE ALSO
94 .sp
95 .LP
96 \fBlabel_to_str\fR(3TSOL), \fBlibtsol\fR(3LIB), \fBattributes\fR(5)
97 .SH NOTES
98 .sp
99 .LP
100 The functionality described on this manual page is available only if the system
101 is configured with Trusted Extensions.
104 If \fIlabel\fR includes a specified word or words, the character-coded color
105 name associated with the first word specified in the label encodings file is
106 returned. Otherwise, if no character-coded color name is specified for
107 \fIlabel\fR, the first character-coded color name specified in the label
108 encodings file with the same classification as the binary label is returned.