mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-19 08:50:43 +01:00
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>
This commit is contained in:
parent
1b6f498b84
commit
7cec236a03
1 changed files with 11 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue