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