1
/************************************************************
3
Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
5
Permission to use, copy, modify, distribute, and sell this software and its
6
documentation for any purpose is hereby granted without fee, provided that
7
this permission notice appear in supporting documentation. This permission
8
notice shall be included in all copies or substantial portions of the
11
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
15
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
********************************************************/
25
#define XACE_MAJOR_VERSION 2
26
#define XACE_MINOR_VERSION 0
32
#include "selection.h"
34
/* Default window background */
35
#define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None)
38
/* Constants used to identify the available security hooks
40
#define XACE_CORE_DISPATCH 0
41
#define XACE_EXT_DISPATCH 1
42
#define XACE_RESOURCE_ACCESS 2
43
#define XACE_DEVICE_ACCESS 3
44
#define XACE_PROPERTY_ACCESS 4
45
#define XACE_SEND_ACCESS 5
46
#define XACE_RECEIVE_ACCESS 6
47
#define XACE_CLIENT_ACCESS 7
48
#define XACE_EXT_ACCESS 8
49
#define XACE_SERVER_ACCESS 9
50
#define XACE_SELECTION_ACCESS 10
51
#define XACE_SCREEN_ACCESS 11
52
#define XACE_SCREENSAVER_ACCESS 12
53
#define XACE_AUTH_AVAIL 13
54
#define XACE_KEY_AVAIL 14
55
#define XACE_AUDIT_BEGIN 15
56
#define XACE_AUDIT_END 16
57
#define XACE_NUM_HOOKS 17
59
extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
61
/* Entry point for hook functions. Called by Xserver.
65
... /*appropriate args for hook*/
68
/* Special-cased hook functions
70
extern int XaceHookDispatch(ClientPtr ptr, int major);
71
extern int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
72
PropertyPtr *ppProp, Mask access_mode);
73
extern int XaceHookSelectionAccess(ClientPtr ptr,
74
Selection **ppSel, Mask access_mode);
75
extern void XaceHookAuditEnd(ClientPtr ptr, int result);
77
/* Register a callback for a given hook.
79
#define XaceRegisterCallback(hook,callback,data) \
80
AddCallback(XaceHooks+(hook), callback, data)
82
/* Unregister an existing callback for a given hook.
84
#define XaceDeleteCallback(hook,callback,data) \
85
DeleteCallback(XaceHooks+(hook), callback, data)
88
/* From the original Security extension...
91
extern void XaceCensorImage(
93
RegionPtr pVisibleRegion,
96
int x, int y, int w, int h,
103
/* Default window background */
104
#define XaceBackgroundNoneState(w) None
106
/* Define calls away when XACE is not being built. */
109
#define XaceHook(args...) Success
110
#define XaceHookDispatch(args...) Success
111
#define XaceHookPropertyAccess(args...) Success
112
#define XaceHookSelectionAccess(args...) Success
113
#define XaceHookAuditEnd(args...) { ; }
114
#define XaceCensorImage(args...) { ; }
116
#define XaceHook(...) Success
117
#define XaceHookDispatch(...) Success
118
#define XaceHookPropertyAccess(...) Success
119
#define XaceHookSelectionAccess(...) Success
120
#define XaceHookAuditEnd(...) { ; }
121
#define XaceCensorImage(...) { ; }