1 /* Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
27 #include <sys/types.h>
28 #include <bsm/audit.h>
30 #include <tsol/label.h>
34 #endif /* _XTSOL_SERVER */
36 #include <X11/Xfuncproto.h>
40 typedef enum { IsWindow
, IsPixmap
, IsColormap
} ResourceType
;
43 * Name of the Trusted Solaris extension
45 #define TSOLNAME "SUN_TSOL"
48 * Resource value masks
49 * The following resource masks are obsolete:
50 * RES_IL 2 # information label
51 * RES_IIL 4 # input info label
54 #define RES_SL 1 /* sensitivity label */
55 #define RES_UID 8 /* user id */
56 #define RES_OUID 16 /* owner uid */
57 #define RES_STRIPE 32 /* screen stripe */
58 #define RES_LABEL (RES_SL)
59 #define RES_ALL (RES_SL|RES_UID|RES_OUID)
62 typedef struct _XTsolResAttributes
{
63 CARD32 ouid
; /* owner uid */
65 m_label_t
*sl
; /* sensitivity label */
68 typedef struct _XTsolPropAttributes
{
70 m_label_t
*sl
; /* sensitivity label */
71 } XTsolPropAttributes
;
76 typedef struct _XTsolClientAttributes
{
77 int trustflag
; /* true, if client masked as trusted */
78 uid_t uid
; /* owner uid */
79 gid_t gid
; /* group id */
80 pid_t pid
; /* process id */
81 u_long sessionid
; /* session id */
82 au_id_t auditid
; /* audit id */
83 u_long iaddr
; /* internet addr */
84 } XTsolClientAttributes
;
87 * Trusted X Server Interfaces
88 * Status value 0 means failure, else success
89 * Status is defined in Xlib.h for user includes.
98 extern Bool
XTSOLIsWindowTrusted(
99 #if NeedFunctionPrototypes
105 extern Status
XTSOLsetPolyInstInfo(
106 #if NeedFunctionPrototypes
114 extern Status
XTSOLsetPropLabel(
115 #if NeedFunctionPrototypes
123 extern Status
XTSOLsetPropUID(
124 #if NeedFunctionPrototypes
132 extern Status
XTSOLsetResLabel(
133 #if NeedFunctionPrototypes
136 ResourceType resourceFlag
,
141 extern Status
XTSOLsetResUID(
142 #if NeedFunctionPrototypes
145 ResourceType resourceFlag
,
150 extern Status
XTSOLsetSSHeight(
151 #if NeedFunctionPrototypes
158 extern Status
XTSOLgetSSHeight(
159 #if NeedFunctionPrototypes
166 extern Status
XTSOLsetSessionHI(
167 #if NeedFunctionPrototypes
173 extern Status
XTSOLsetSessionLO(
174 #if NeedFunctionPrototypes
180 extern Status
XTSOLsetWorkstationOwner(
181 #if NeedFunctionPrototypes
187 extern Status
XTSOLgetClientAttributes(
188 #if NeedFunctionPrototypes
191 XTsolClientAttributes
*clientattr
195 extern Status
XTSOLgetClientLabel(
196 #if NeedFunctionPrototypes
203 extern Status
XTSOLgetPropAttributes(
204 #if NeedFunctionPrototypes
208 XTsolPropAttributes
*propattrp
212 extern Status
XTSOLgetPropLabel(
213 #if NeedFunctionPrototypes
221 extern Status
XTSOLgetPropUID(
222 #if NeedFunctionPrototypes
230 extern Status
XTSOLgetResAttributes(
231 #if NeedFunctionPrototypes
234 ResourceType resourceFlag
,
235 XTsolResAttributes
*resattrp
239 extern Status
XTSOLgetResLabel(
240 #if NeedFunctionPrototypes
243 ResourceType resourceFlag
,
248 extern Status
XTSOLgetResUID(
249 #if NeedFunctionPrototypes
252 ResourceType resourceFlag
,
257 extern Status
XTSOLgetWorkstationOwner(
258 #if NeedFunctionPrototypes
264 extern Status
XTSOLMakeTPWindow(
265 #if NeedFunctionPrototypes
271 extern Status
XTSOLMakeTrustedWindow(
272 #if NeedFunctionPrototypes
278 extern Status
XTSOLMakeUntrustedWindow(
279 #if NeedFunctionPrototypes
285 #endif /* _XTSOL_SERVER */
289 #endif /* _XTSOL_H_ */