diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-14 11:39:26 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-14 11:39:26 -0400 |
commit | 9a183d7ba50e31afa133cc03aee7991517a283ea (patch) | |
tree | a77da3210253f96d5d0be97a8a321920648ca81f /dix/dixutils.c | |
parent | 2763056ab5ae31bed422a0948198d98c6ace6d55 (diff) |
dix: remove caching of drawables and graphics contexts. The security checks
simply bypass the cached values so they are unused.
Diffstat (limited to 'dix/dixutils.c')
-rw-r--r-- | dix/dixutils.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/dix/dixutils.c b/dix/dixutils.c index 14ef7e674..e8d7daf06 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -208,7 +208,6 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, Mask type, Mask access) { DrawablePtr pTmp; - RESTYPE rtype; int rc; *pDraw = NULL; @@ -217,28 +216,15 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, if (id == INVALID) return BadDrawable; - if (id == client->lastDrawableID) { - pTmp = client->lastDrawable; + rc = dixLookupResource((pointer *)&pTmp, id, RC_DRAWABLE, client, access); - /* an access check is required for cached drawables */ - rtype = (type & M_WINDOW) ? RT_WINDOW : RT_PIXMAP; - rc = XaceHook(XACE_RESOURCE_ACCESS, client, id, rtype, access, pTmp); - if (rc != Success) - return rc; - } else - dixLookupResource((void **)&pTmp, id, RC_DRAWABLE, client, access); - - if (!pTmp) + if (rc == BadValue) return BadDrawable; + if (rc != Success) + return rc; if (!((1 << pTmp->type) & (type ? type : M_DRAWABLE))) return BadMatch; - if (type & M_DRAWABLE) { - client->lastDrawable = pTmp; - client->lastDrawableID = id; - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } *pDraw = pTmp; return Success; } |