diff options
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/shm.c | 26 | ||||
-rw-r--r-- | Xext/xevie.c | 26 |
2 files changed, 47 insertions, 5 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index 29eab06f5..7293d5b7a 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -69,6 +69,10 @@ in this Software without prior written authorization from The Open Group. #include "modinit.h" +#ifdef LG3D +#include "lgeint.h" +#endif /* LG3D */ + typedef struct _ShmDesc { struct _ShmDesc *next; int shmid; @@ -447,11 +451,22 @@ ProcShmAttach(client) * do manual checking of access rights for the credentials * of the client */ - if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { - shmdt(shmdesc->addr); - xfree(shmdesc); - return BadAccess; +#ifdef LG3D + /* + ** Skip this access check when talking to the display server. + ** TODO: POSSIBLE SECURITY HOLE: make sure that only the + ** actual LG Display Server can ever set this. + */ + if (!lgeDisplayServerIsAlive) { +#endif /* LG3D */ + if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) { + shmdt(shmdesc->addr); + xfree(shmdesc); + return BadAccess; + } +#ifdef LG3D } +#endif /* LG3D */ shmdesc->shmid = stuff->shmid; shmdesc->refcnt = 1; @@ -1229,6 +1244,9 @@ SProcShmCreatePixmap(client) REQUEST(xShmCreatePixmapReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xShmCreatePixmapReq); +#ifdef LG3D + swapl(&stuff->pid, n); +#endif /* LG3D */ swapl(&stuff->drawable, n); swaps(&stuff->width, n); swaps(&stuff->height, n); diff --git a/Xext/xevie.c b/Xext/xevie.c index b024a622a..ed755f10c 100644 --- a/Xext/xevie.c +++ b/Xext/xevie.c @@ -127,6 +127,11 @@ int ProcQueryVersion (client) rep.sequence_number = client->sequence; rep.server_major_version = XEVIE_MAJOR_VERSION; rep.server_minor_version = XEVIE_MINOR_VERSION; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.server_major_version, n); + swapl(&rep.server_minor_version, n); + } WriteToClient (client, sizeof (xXevieQueryVersionReply), (char *)&rep); return client->noClientException; } @@ -153,7 +158,11 @@ int ProcStart (client) return BadAccess; rep.type = X_Reply; + rep.length = 0; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + } WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep); return client->noClientException; } @@ -163,11 +172,16 @@ int ProcEnd (client) register ClientPtr client; { xXevieEndReply rep; + register int n; XevieEnd(xevieClientIndex); rep.type = X_Reply; + rep.length = 0; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + } WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep); return client->noClientException; } @@ -181,10 +195,15 @@ int ProcSend (client) xEvent *xE; OsCommPtr oc; static unsigned char lastDetail = 0, lastType = 0; + register int n; xE = (xEvent *)&stuff->event; rep.type = X_Reply; + rep.length = 0; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + } WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep); switch(xE->u.u.type) { @@ -216,10 +235,15 @@ int ProcSelectInput (client) { REQUEST (xXevieSelectInputReq); xXevieSelectInputReply rep; + register int n; xevieMask = (long)stuff->event_mask; rep.type = X_Reply; + rep.length = 0; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + } WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep); return client->noClientException; } @@ -308,7 +332,7 @@ int SProcSelectInput (client) REQUEST (xXevieSelectInputReq); swaps (&stuff->length, n); - REQUEST_AT_LEAST_SIZE (xXevieSendReq); + REQUEST_AT_LEAST_SIZE (xXevieSelectInputReq); swapl(&stuff->event_mask, n); return ProcSelectInput (client); } |