1706f2543Smrg/*
2706f2543SmrgCopyright 1996, 1998  The Open Group
3706f2543Smrg
4706f2543SmrgPermission to use, copy, modify, distribute, and sell this software and its
5706f2543Smrgdocumentation for any purpose is hereby granted without fee, provided that
6706f2543Smrgthe above copyright notice appear in all copies and that both that
7706f2543Smrgcopyright notice and this permission notice appear in supporting
8706f2543Smrgdocumentation.
9706f2543Smrg
10706f2543SmrgThe above copyright notice and this permission notice shall be included
11706f2543Smrgin all copies or substantial portions of the Software.
12706f2543Smrg
13706f2543SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14706f2543SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15706f2543SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16706f2543SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17706f2543SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18706f2543SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19706f2543SmrgOTHER DEALINGS IN THE SOFTWARE.
20706f2543Smrg
21706f2543SmrgExcept as contained in this notice, the name of The Open Group shall
22706f2543Smrgnot be used in advertising or otherwise to promote the sale, use or
23706f2543Smrgother dealings in this Software without prior written authorization
24706f2543Smrgfrom The Open Group.
25706f2543Smrg*/
26706f2543Smrg
27706f2543Smrg/* Xserver internals for Security extension - moved here from
28706f2543Smrg   _SECURITY_SERVER section of <X11/extensions/security.h> */
29706f2543Smrg
30706f2543Smrg#ifndef _SECURITY_SRV_H
31706f2543Smrg#define _SECURITY_SRV_H
32706f2543Smrg
33706f2543Smrg/* Allow client side portions of <X11/extensions/security.h> to compile */
34706f2543Smrg#ifndef Status
35706f2543Smrg# define Status int
36706f2543Smrg# define NEED_UNDEF_Status
37706f2543Smrg#endif
38706f2543Smrg#ifndef Display
39706f2543Smrg# define Display void
40706f2543Smrg# define NEED_UNDEF_Display
41706f2543Smrg#endif
42706f2543Smrg
43706f2543Smrg#include <X11/extensions/secur.h>
44706f2543Smrg
45706f2543Smrg#ifdef NEED_UNDEF_Status
46706f2543Smrg# undef Status
47706f2543Smrg# undef NEED_UNDEF_Status
48706f2543Smrg#endif
49706f2543Smrg#ifdef NEED_UNDEF_Display
50706f2543Smrg# undef Display
51706f2543Smrg# undef NEED_UNDEF_Display
52706f2543Smrg#endif
53706f2543Smrg
54706f2543Smrg
55706f2543Smrg#include "input.h"    /* for DeviceIntPtr */
56706f2543Smrg#include "property.h" /* for PropertyPtr */
57706f2543Smrg#include "pixmap.h"   /* for DrawablePtr */
58706f2543Smrg#include "resource.h" /* for RESTYPE */
59706f2543Smrg
60706f2543Smrg/* resource type to pass in LookupIDByType for authorizations */
61706f2543Smrgextern RESTYPE SecurityAuthorizationResType;
62706f2543Smrg
63706f2543Smrg/* this is what we store for an authorization */
64706f2543Smrgtypedef struct {
65706f2543Smrg    XID id;			/* resource ID */
66706f2543Smrg    CARD32 timeout;	/* how long to live in seconds after refcnt == 0 */
67706f2543Smrg    unsigned int trustLevel;	/* trusted/untrusted */
68706f2543Smrg    XID group;			/* see embedding extension */
69706f2543Smrg    unsigned int refcnt;	/* how many clients connected with this auth */
70706f2543Smrg    unsigned int secondsRemaining; /* overflow time amount for >49 days */
71706f2543Smrg    OsTimerPtr timer;		/* timer for this auth */
72706f2543Smrg    struct _OtherClients *eventClients; /* clients wanting events */
73706f2543Smrg} SecurityAuthorizationRec, *SecurityAuthorizationPtr;
74706f2543Smrg
75706f2543Smrgtypedef struct {
76706f2543Smrg    XID group;	/* the group that was sent in GenerateAuthorization */
77706f2543Smrg    Bool valid; /* did anyone recognize it? if so, set to TRUE */
78706f2543Smrg} SecurityValidateGroupInfoRec;
79706f2543Smrg
80706f2543Smrg/* Give this value or higher to the -audit option to get security messages */
81706f2543Smrg#define SECURITY_AUDIT_LEVEL 4
82706f2543Smrg
83706f2543Smrg#endif /* _SECURITY_SRV_H */
84