summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2010-02-03 15:08:40 -0500
committerEamon Walsh <ewalsh@tycho.nsa.gov>2010-02-22 17:04:39 -0500
commitab68c707fd02613d9359120ba6402639dd8bd89e (patch)
tree73b8021ea3fe8659fa66af5644c5ce0c0104082b /Xext
parenteb9210097efea81065c301e5b6b4da7a566deb4a (diff)
xselinux: Allow GetWindowContext to be used for pixmaps as well.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/xselinux_ext.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index dc27c92ed..1dff32d14 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -223,18 +223,26 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
static int
ProcSELinuxGetWindowContext(ClientPtr client)
{
- WindowPtr pWin;
+ DrawablePtr pDraw;
+ PrivateRec **privatePtr;
SELinuxObjectRec *obj;
int rc;
REQUEST(SELinuxGetContextReq);
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
+ rc = dixLookupDrawable(&pDraw, stuff->id, client,
+ M_WINDOW | M_DRAWABLE_PIXMAP,
+ DixGetAttrAccess);
if (rc != Success)
return rc;
- obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
+ if (pDraw->type == M_DRAWABLE_PIXMAP)
+ privatePtr = &((PixmapPtr)pDraw)->devPrivates;
+ else
+ privatePtr = &((WindowPtr)pDraw)->devPrivates;
+
+ obj = dixLookupPrivate(privatePtr, objectKey);
return SELinuxSendContextReply(client, obj->sid);
}