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