1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
/************************************************************
Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
this permission notice appear in supporting documentation. This permission
notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
********************************************************/
#ifndef _XSELINUX_H
#define _XSELINUX_H
#include "dixaccess.h"
/* Extension info */
#define SELINUX_EXTENSION_NAME "SELinux"
#define SELINUX_MAJOR_VERSION 1
#define SELINUX_MINOR_VERSION 0
#define SELinuxNumberEvents 0
#define SELinuxNumberErrors 0
/* Extension protocol */
#define X_SELinuxQueryVersion 0
#define X_SELinuxSetSecurityManager 1
#define X_SELinuxGetSecurityManager 2
#define X_SELinuxSetDeviceCreateContext 3
#define X_SELinuxGetDeviceCreateContext 4
#define X_SELinuxSetDeviceContext 5
#define X_SELinuxGetDeviceContext 6
#define X_SELinuxSetPropertyCreateContext 7
#define X_SELinuxGetPropertyCreateContext 8
#define X_SELinuxGetPropertyContext 9
#define X_SELinuxSetWindowCreateContext 10
#define X_SELinuxGetWindowCreateContext 11
#define X_SELinuxGetWindowContext 12
#define X_SELinuxSetSelectionCreateContext 13
#define X_SELinuxGetSelectionCreateContext 14
#define X_SELinuxGetSelectionContext 15
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD8 client_major;
CARD8 client_minor;
CARD16 unused;
} SELinuxQueryVersionReq;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD16 server_major;
CARD16 server_minor;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxQueryVersionReply;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 window;
} SELinuxSetSecurityManagerReq;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
} SELinuxGetSecurityManagerReq;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD32 window;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxGetSecurityManagerReply;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD8 permanent;
CARD8 unused;
CARD16 context_len;
} SELinuxSetCreateContextReq;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
} SELinuxGetCreateContextReq;
typedef struct {
CARD8 type;
CARD8 permanent;
CARD16 sequenceNumber;
CARD32 length;
CARD16 context_len;
CARD16 pad1;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
} SELinuxGetCreateContextReply;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 id;
CARD16 unused;
CARD16 context_len;
} SELinuxSetContextReq;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 id;
} SELinuxGetContextReq;
typedef struct {
CARD8 reqType;
CARD8 SELinuxReqType;
CARD16 length;
CARD32 window;
CARD32 property;
} SELinuxGetPropertyContextReq;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD16 context_len;
CARD16 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
CARD32 pad7;
} SELinuxGetContextReply;
/* Private Flask definitions */
#define SECCLASS_X_DRAWABLE 1
#define SECCLASS_X_SCREEN 2
#define SECCLASS_X_GC 3
#define SECCLASS_X_FONT 4
#define SECCLASS_X_COLORMAP 5
#define SECCLASS_X_PROPERTY 6
#define SECCLASS_X_SELECTION 7
#define SECCLASS_X_CURSOR 8
#define SECCLASS_X_CLIENT 9
#define SECCLASS_X_DEVICE 10
#define SECCLASS_X_SERVER 11
#define SECCLASS_X_EXTENSION 12
#define SECCLASS_X_EVENT 13
#define SECCLASS_X_FAKEEVENT 14
#define SECCLASS_X_RESOURCE 15
#endif /* _XSELINUX_H */
|