1 | /*
|
---|
2 | Copyright 1996, 1998 The Open Group
|
---|
3 |
|
---|
4 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
5 | documentation for any purpose is hereby granted without fee, provided that
|
---|
6 | the above copyright notice appear in all copies and that both that
|
---|
7 | copyright notice and this permission notice appear in supporting
|
---|
8 | documentation.
|
---|
9 |
|
---|
10 | The above copyright notice and this permission notice shall be included
|
---|
11 | in all copies or substantial portions of the Software.
|
---|
12 |
|
---|
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
---|
16 | IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
17 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
18 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
19 | OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall
|
---|
22 | not be used in advertising or otherwise to promote the sale, use or
|
---|
23 | other dealings in this Software without prior written authorization
|
---|
24 | from The Open Group.
|
---|
25 | */
|
---|
26 |
|
---|
27 | /* Xserver internals for Security extension - moved here from
|
---|
28 | _SECURITY_SERVER section of <X11/extensions/security.h> */
|
---|
29 |
|
---|
30 | #ifndef _SECURITY_SRV_H
|
---|
31 | #define _SECURITY_SRV_H
|
---|
32 |
|
---|
33 | /* Allow client side portions of <X11/extensions/security.h> to compile */
|
---|
34 | #ifndef Status
|
---|
35 | # define Status int
|
---|
36 | # define NEED_UNDEF_Status
|
---|
37 | #endif
|
---|
38 | #ifndef Display
|
---|
39 | # define Display void
|
---|
40 | # define NEED_UNDEF_Display
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #include <X11/extensions/security.h>
|
---|
44 |
|
---|
45 | #ifdef NEED_UNDEF_Status
|
---|
46 | # undef Status
|
---|
47 | # undef NEED_UNDEF_Status
|
---|
48 | #endif
|
---|
49 | #ifdef NEED_UNDEF_Display
|
---|
50 | # undef Display
|
---|
51 | # undef NEED_UNDEF_Display
|
---|
52 | #endif
|
---|
53 |
|
---|
54 |
|
---|
55 | #include "input.h" /* for DeviceIntPtr */
|
---|
56 | #include "property.h" /* for PropertyPtr */
|
---|
57 | #include "pixmap.h" /* for DrawablePtr */
|
---|
58 | #include "resource.h" /* for RESTYPE */
|
---|
59 |
|
---|
60 | /* resource type to pass in LookupIDByType for authorizations */
|
---|
61 | extern RESTYPE SecurityAuthorizationResType;
|
---|
62 |
|
---|
63 | /* this is what we store for an authorization */
|
---|
64 | typedef struct {
|
---|
65 | XID id; /* resource ID */
|
---|
66 | CARD32 timeout; /* how long to live in seconds after refcnt == 0 */
|
---|
67 | unsigned int trustLevel; /* trusted/untrusted */
|
---|
68 | XID group; /* see embedding extension */
|
---|
69 | unsigned int refcnt; /* how many clients connected with this auth */
|
---|
70 | unsigned int secondsRemaining; /* overflow time amount for >49 days */
|
---|
71 | OsTimerPtr timer; /* timer for this auth */
|
---|
72 | struct _OtherClients *eventClients; /* clients wanting events */
|
---|
73 | } SecurityAuthorizationRec, *SecurityAuthorizationPtr;
|
---|
74 |
|
---|
75 | /* The following callback is called when a GenerateAuthorization request
|
---|
76 | * is processed to sanity check the group argument. The call data will
|
---|
77 | * be a pointer to a SecurityValidateGroupInfoRec (below).
|
---|
78 | * Functions registered on this callback are expected to examine the
|
---|
79 | * group and set the valid field to TRUE if they recognize the group as a
|
---|
80 | * legitimate group. If they don't recognize it, they should not change the
|
---|
81 | * valid field.
|
---|
82 | */
|
---|
83 | extern CallbackListPtr SecurityValidateGroupCallback;
|
---|
84 | typedef struct {
|
---|
85 | XID group; /* the group that was sent in GenerateAuthorization */
|
---|
86 | Bool valid; /* did anyone recognize it? if so, set to TRUE */
|
---|
87 | } SecurityValidateGroupInfoRec;
|
---|
88 |
|
---|
89 | extern int XSecurityOptions(int argc, char **argv, int i);
|
---|
90 |
|
---|
91 | /* Give this value or higher to the -audit option to get security messages */
|
---|
92 | #define SECURITY_AUDIT_LEVEL 4
|
---|
93 |
|
---|
94 | #define SECURITY_POLICY_FILE_VERSION "version-1"
|
---|
95 |
|
---|
96 | extern char **SecurityGetSitePolicyStrings(int *n);
|
---|
97 |
|
---|
98 | #endif /* _SECURITY_SRV_H */
|
---|