aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/xselinux_ext.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-24 18:34:17 +0000
committermarha <marha@users.sourceforge.net>2010-02-24 18:34:17 +0000
commit24bc15a386e37908396c3f6088f6fc98ceaa0f46 (patch)
treec66f27ec96c869f10ef53d73ed7dd5e5e0860605 /xorg-server/Xext/xselinux_ext.c
parent6f0a8e51f20073ea01ac5dae8e5c4d49076fc65e (diff)
downloadvcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.tar.gz
vcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.tar.bz2
vcxsrv-24bc15a386e37908396c3f6088f6fc98ceaa0f46.zip
Git update 24/2/2010"
Diffstat (limited to 'xorg-server/Xext/xselinux_ext.c')
-rw-r--r--xorg-server/Xext/xselinux_ext.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/xorg-server/Xext/xselinux_ext.c b/xorg-server/Xext/xselinux_ext.c
index b36fb13eb..aa5573455 100644
--- a/xorg-server/Xext/xselinux_ext.c
+++ b/xorg-server/Xext/xselinux_ext.c
@@ -132,7 +132,6 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
ptr = dixLookupPrivate(privPtr, subjectKey);
pSid = (security_id_t *)(ptr + offset);
- sidput(*pSid);
*pSid = NULL;
rc = Success;
@@ -193,11 +192,9 @@ ProcSELinuxSetDeviceContext(ClientPtr client)
}
subj = dixLookupPrivate(&dev->devPrivates, subjectKey);
- sidput(subj->sid);
subj->sid = sid;
obj = dixLookupPrivate(&dev->devPrivates, objectKey);
- sidput(obj->sid);
- sidget(obj->sid = sid);
+ obj->sid = sid;
rc = Success;
out:
@@ -224,20 +221,28 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
}
static int
-ProcSELinuxGetWindowContext(ClientPtr client)
+ProcSELinuxGetDrawableContext(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);
}
@@ -481,12 +486,12 @@ ProcSELinuxDispatch(ClientPtr client)
return ProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext:
return ProcSELinuxGetDeviceContext(client);
- case X_SELinuxSetWindowCreateContext:
+ case X_SELinuxSetDrawableCreateContext:
return ProcSELinuxSetCreateContext(client, CTX_WIN);
- case X_SELinuxGetWindowCreateContext:
+ case X_SELinuxGetDrawableCreateContext:
return ProcSELinuxGetCreateContext(client, CTX_WIN);
- case X_SELinuxGetWindowContext:
- return ProcSELinuxGetWindowContext(client);
+ case X_SELinuxGetDrawableContext:
+ return ProcSELinuxGetDrawableContext(client);
case X_SELinuxSetPropertyCreateContext:
return ProcSELinuxSetCreateContext(client, CTX_PRP);
case X_SELinuxGetPropertyCreateContext:
@@ -569,14 +574,14 @@ SProcSELinuxGetDeviceContext(ClientPtr client)
}
static int
-SProcSELinuxGetWindowContext(ClientPtr client)
+SProcSELinuxGetDrawableContext(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
swapl(&stuff->id, n);
- return ProcSELinuxGetWindowContext(client);
+ return ProcSELinuxGetDrawableContext(client);
}
static int
@@ -643,12 +648,12 @@ SProcSELinuxDispatch(ClientPtr client)
return SProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext:
return SProcSELinuxGetDeviceContext(client);
- case X_SELinuxSetWindowCreateContext:
+ case X_SELinuxSetDrawableCreateContext:
return SProcSELinuxSetCreateContext(client, CTX_WIN);
- case X_SELinuxGetWindowCreateContext:
+ case X_SELinuxGetDrawableCreateContext:
return ProcSELinuxGetCreateContext(client, CTX_WIN);
- case X_SELinuxGetWindowContext:
- return SProcSELinuxGetWindowContext(client);
+ case X_SELinuxGetDrawableContext:
+ return SProcSELinuxGetDrawableContext(client);
case X_SELinuxSetPropertyCreateContext:
return SProcSELinuxSetCreateContext(client, CTX_PRP);
case X_SELinuxGetPropertyCreateContext: