mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Replace XC-SECURITY code with XACE security hooks
(cherry picked from 8526cd6395 commit)
This commit is contained in:
committed by
Alan Coopersmith
parent
8d9ccc90a5
commit
37f0ae0245
@@ -89,12 +89,9 @@ SOFTWARE.
|
||||
((client->lastDrawableID == did) ? \
|
||||
client->lastDrawable : (DrawablePtr)LookupDrawable(did, client))
|
||||
|
||||
#ifdef XCSECURITY
|
||||
#ifdef XACE
|
||||
|
||||
#define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\
|
||||
if (client->lastDrawableID == did && !client->trustLevel)\
|
||||
pDraw = client->lastDrawable;\
|
||||
else \
|
||||
{\
|
||||
pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
|
||||
RC_DRAWABLE, mode);\
|
||||
@@ -108,9 +105,6 @@ SOFTWARE.
|
||||
}
|
||||
|
||||
#define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\
|
||||
if (client->lastDrawableID == did && !client->trustLevel)\
|
||||
pDraw = client->lastDrawable;\
|
||||
else \
|
||||
{\
|
||||
pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \
|
||||
RC_DRAWABLE, mode);\
|
||||
@@ -122,9 +116,6 @@ SOFTWARE.
|
||||
}
|
||||
|
||||
#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
|
||||
if (client->lastGCID == rid && !client->trustLevel)\
|
||||
pGC = client->lastGC;\
|
||||
else\
|
||||
pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\
|
||||
if (!pGC)\
|
||||
{\
|
||||
@@ -141,7 +132,7 @@ SOFTWARE.
|
||||
#define VERIFY_GC(pGC, rid, client)\
|
||||
SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess)
|
||||
|
||||
#else /* not XCSECURITY */
|
||||
#else /* not XACE */
|
||||
|
||||
#define VERIFY_DRAWABLE(pDraw, did, client)\
|
||||
if (client->lastDrawableID == did)\
|
||||
@@ -191,7 +182,7 @@ SOFTWARE.
|
||||
#define SECURITY_VERIFY_GC(pGC, rid, client, mode)\
|
||||
VERIFY_GC(pGC, rid, client)
|
||||
|
||||
#endif /* XCSECURITY */
|
||||
#endif /* XACE */
|
||||
|
||||
/*
|
||||
* We think that most hardware implementations of DBE will want
|
||||
@@ -386,7 +377,7 @@ extern int CompareISOLatin1Lowered(
|
||||
unsigned char * /*b*/,
|
||||
int blen);
|
||||
|
||||
#ifdef XCSECURITY
|
||||
#ifdef XACE
|
||||
|
||||
extern WindowPtr SecurityLookupWindow(
|
||||
XID /*rid*/,
|
||||
@@ -422,7 +413,7 @@ extern pointer LookupDrawable(
|
||||
#define SecurityLookupDrawable(rid, client, access_mode) \
|
||||
LookupDrawable(rid, client)
|
||||
|
||||
#endif /* XCSECURITY */
|
||||
#endif /* XACE */
|
||||
|
||||
extern ClientPtr LookupClient(
|
||||
XID /*rid*/,
|
||||
|
||||
@@ -130,15 +130,8 @@ typedef struct _Client {
|
||||
int requestLogIndex;
|
||||
#endif
|
||||
unsigned long replyBytesRemaining;
|
||||
#ifdef XCSECURITY
|
||||
XID authId;
|
||||
unsigned int trustLevel;
|
||||
pointer (* CheckAccess)(
|
||||
ClientPtr /*pClient*/,
|
||||
XID /*id*/,
|
||||
RESTYPE /*classes*/,
|
||||
Mask /*access_mode*/,
|
||||
pointer /*resourceval*/);
|
||||
#ifdef XACE
|
||||
pointer securityState[4]; /* 4 slots for use */
|
||||
#endif
|
||||
#ifdef XAPPGROUP
|
||||
struct _AppGroupRec* appgroup;
|
||||
|
||||
@@ -71,7 +71,7 @@ typedef struct _ExtensionEntry {
|
||||
unsigned short (* MinorOpcode)( /* called for errors */
|
||||
ClientPtr /* client */);
|
||||
#ifdef XCSECURITY
|
||||
Bool secure; /* extension visible to untrusted clients? */
|
||||
pointer securityState[4]; /* 4 slots for use */
|
||||
#endif
|
||||
} ExtensionEntry;
|
||||
|
||||
@@ -129,6 +129,7 @@ extern Bool AddExtensionAlias(
|
||||
ExtensionEntry * /*extension*/);
|
||||
|
||||
extern ExtensionEntry *CheckExtension(const char *extname);
|
||||
extern ExtensionEntry *GetExtensionEntry(int major);
|
||||
|
||||
extern ExtensionLookupProc LookupProc(
|
||||
char* /*name*/,
|
||||
|
||||
@@ -227,7 +227,7 @@ extern pointer LookupClientResourceComplex(
|
||||
#define SecurityWriteAccess (1<<1) /* changing the object */
|
||||
#define SecurityDestroyAccess (1<<2) /* destroying the object */
|
||||
|
||||
#ifdef XCSECURITY
|
||||
#ifdef XACE
|
||||
|
||||
extern pointer SecurityLookupIDByType(
|
||||
ClientPtr /*client*/,
|
||||
@@ -241,7 +241,7 @@ extern pointer SecurityLookupIDByClass(
|
||||
RESTYPE /*classes*/,
|
||||
Mask /*access_mode*/);
|
||||
|
||||
#else /* not XCSECURITY */
|
||||
#else /* not XACE */
|
||||
|
||||
#define SecurityLookupIDByType(client, id, rtype, access_mode) \
|
||||
LookupIDByType(id, rtype)
|
||||
@@ -249,7 +249,7 @@ extern pointer SecurityLookupIDByClass(
|
||||
#define SecurityLookupIDByClass(client, id, classes, access_mode) \
|
||||
LookupIDByClass(id, classes)
|
||||
|
||||
#endif /* XCSECURITY */
|
||||
#endif /* XACE */
|
||||
|
||||
extern void GetXIDRange(
|
||||
int /*client*/,
|
||||
|
||||
Reference in New Issue
Block a user