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