xref: /titanic_41/usr/src/uts/common/sys/tsol/priv.h (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
1*45916cd2Sjpk /*
2*45916cd2Sjpk  * CDDL HEADER START
3*45916cd2Sjpk  *
4*45916cd2Sjpk  * The contents of this file are subject to the terms of the
5*45916cd2Sjpk  * Common Development and Distribution License (the "License").
6*45916cd2Sjpk  * You may not use this file except in compliance with the License.
7*45916cd2Sjpk  *
8*45916cd2Sjpk  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*45916cd2Sjpk  * or http://www.opensolaris.org/os/licensing.
10*45916cd2Sjpk  * See the License for the specific language governing permissions
11*45916cd2Sjpk  * and limitations under the License.
12*45916cd2Sjpk  *
13*45916cd2Sjpk  * When distributing Covered Code, include this CDDL HEADER in each
14*45916cd2Sjpk  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*45916cd2Sjpk  * If applicable, add the following below this CDDL HEADER, with the
16*45916cd2Sjpk  * fields enclosed by brackets "[]" replaced with your own identifying
17*45916cd2Sjpk  * information: Portions Copyright [yyyy] [name of copyright owner]
18*45916cd2Sjpk  *
19*45916cd2Sjpk  * CDDL HEADER END
20*45916cd2Sjpk  */
21*45916cd2Sjpk /*
22*45916cd2Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*45916cd2Sjpk  * Use is subject to license terms.
24*45916cd2Sjpk  */
25*45916cd2Sjpk 
26*45916cd2Sjpk #ifndef	_SYS_TSOL_PRIV_H
27*45916cd2Sjpk #define	_SYS_TSOL_PRIV_H
28*45916cd2Sjpk 
29*45916cd2Sjpk #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*45916cd2Sjpk 
31*45916cd2Sjpk #include <sys/priv.h>
32*45916cd2Sjpk 
33*45916cd2Sjpk #ifdef	__cplusplus
34*45916cd2Sjpk extern "C" {
35*45916cd2Sjpk #endif
36*45916cd2Sjpk 
37*45916cd2Sjpk typedef enum priv_ftype {
38*45916cd2Sjpk 	PRIV_ALLOWED,
39*45916cd2Sjpk 	PRIV_FORCED
40*45916cd2Sjpk } priv_ftype_t;
41*45916cd2Sjpk 
42*45916cd2Sjpk /*
43*45916cd2Sjpk  * Privilege macros.
44*45916cd2Sjpk  */
45*45916cd2Sjpk 
46*45916cd2Sjpk /*
47*45916cd2Sjpk  * PRIV_ASSERT(a, b) setst.privilege "b" in privilege set "a".
48*45916cd2Sjpk  */
49*45916cd2Sjpk #define	PRIV_ASSERT(a, b) (priv_addset(a, b))
50*45916cd2Sjpk 
51*45916cd2Sjpk /*
52*45916cd2Sjpk  * PRIV_CLEAR(a,b) clearst.privilege "b" in privilege set "a".
53*45916cd2Sjpk  */
54*45916cd2Sjpk #define	PRIV_CLEAR(a, b) (priv_delset(a, b))
55*45916cd2Sjpk 
56*45916cd2Sjpk /*
57*45916cd2Sjpk  * PRIV_EQUAL(set_a, set_b) is true if set_a and set_b are identical.
58*45916cd2Sjpk  */
59*45916cd2Sjpk #define	PRIV_EQUAL(a, b) (priv_isequalset(a, b))
60*45916cd2Sjpk #define	PRIV_EMPTY(a) (priv_emptyset(a))
61*45916cd2Sjpk #define	PRIV_FILL(a) (priv_fillset(a))
62*45916cd2Sjpk 
63*45916cd2Sjpk /*
64*45916cd2Sjpk  * PRIV_ISASSERT tests if privilege 'b' is asserted in privilege set 'a'.
65*45916cd2Sjpk  */
66*45916cd2Sjpk #define	PRIV_ISASSERT(a, b) (priv_ismember(a, b))
67*45916cd2Sjpk #define	PRIV_ISEMPTY(a) (priv_isemptyset(a))
68*45916cd2Sjpk #define	PRIV_ISFULL(a) (priv_isfullset(a))
69*45916cd2Sjpk 
70*45916cd2Sjpk /*
71*45916cd2Sjpk  * This macro returns 1 if all privileges asserted in privilege set "a"
72*45916cd2Sjpk  * are also asserted in privilege set "b" (i.e. if a is a subset of b)
73*45916cd2Sjpk  */
74*45916cd2Sjpk #define	PRIV_ISSUBSET(a, b) (priv_issubset(a, b))
75*45916cd2Sjpk 
76*45916cd2Sjpk /*
77*45916cd2Sjpk  * Takes intersection of "a" and "b" and stores in "b".
78*45916cd2Sjpk  */
79*45916cd2Sjpk #define	PRIV_INTERSECT(a, b) (priv_intersect(a, b))
80*45916cd2Sjpk 
81*45916cd2Sjpk /*
82*45916cd2Sjpk  * Replaces "a" with inverse of "a".
83*45916cd2Sjpk  */
84*45916cd2Sjpk #define	PRIV_INVERSE(a)  (priv_inverse(a))
85*45916cd2Sjpk 
86*45916cd2Sjpk /*
87*45916cd2Sjpk  * Takes union of "a" and "b" and stores in "b".
88*45916cd2Sjpk  */
89*45916cd2Sjpk #define	PRIV_UNION(a, b) (priv_union(a, b))
90*45916cd2Sjpk 
91*45916cd2Sjpk 
92*45916cd2Sjpk #define	PRIV_FILE_UPGRADE_SL	((const char *)"file_upgrade_sl")
93*45916cd2Sjpk #define	PRIV_FILE_DOWNGRADE_SL	((const char *)"file_downgrade_sl")
94*45916cd2Sjpk #
95*45916cd2Sjpk #define	PRIV_PROC_AUDIT_TCB	((const char *)"proc_audit")
96*45916cd2Sjpk #define	PRIV_PROC_AUDIT_APPL	((const char *)"proc_audit")
97*45916cd2Sjpk #
98*45916cd2Sjpk #define	PRIV_SYS_TRANS_LABEL	((const char *)"sys_trans_label")
99*45916cd2Sjpk #define	PRIV_WIN_COLORMAP	((const char *)"win_colormap")
100*45916cd2Sjpk #define	PRIV_WIN_CONFIG		((const char *)"win_config")
101*45916cd2Sjpk #define	PRIV_WIN_DAC_READ	((const char *)"win_dac_read")
102*45916cd2Sjpk #define	PRIV_WIN_DAC_WRITE	((const char *)"win_dac_write")
103*45916cd2Sjpk #define	PRIV_WIN_DGA		((const char *)"win_dga")
104*45916cd2Sjpk #define	PRIV_WIN_DEVICES	((const char *)"win_devices")
105*45916cd2Sjpk #define	PRIV_WIN_DOWNGRADE_SL	((const char *)"win_downgrade_sl")
106*45916cd2Sjpk #define	PRIV_WIN_FONTPATH	((const char *)"win_fontpath")
107*45916cd2Sjpk #define	PRIV_WIN_MAC_READ	((const char *)"win_mac_read")
108*45916cd2Sjpk #define	PRIV_WIN_MAC_WRITE	((const char *)"win_mac_write")
109*45916cd2Sjpk #define	PRIV_WIN_SELECTION	((const char *)"win_selection")
110*45916cd2Sjpk #define	PRIV_WIN_UPGRADE_SL	((const char *)"win_upgrade_sl")
111*45916cd2Sjpk 
112*45916cd2Sjpk #ifdef	__cplusplus
113*45916cd2Sjpk }
114*45916cd2Sjpk #endif
115*45916cd2Sjpk 
116*45916cd2Sjpk #endif	/* _SYS_TSOL_PRIV_H */
117