diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2010-02-03 15:08:40 -0500 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2010-02-23 16:43:17 -0500 |
commit | 7cec236a03917841131941ce97bd1dfd4a027327 (patch) | |
tree | e01d3ed0a54babf89b2578691a44047a0120a21c /Xext | |
parent | 1b6f498b84de7f79de735b004b8e16b9a31d228c (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.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Xext/xselinux.c b/Xext/xselinux.c index 4382c2150..a1c1b83d9 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -1357,18 +1357,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); } |