summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-01-09 13:07:25 -0800
committerKeith Packard <keithp@keithp.com>2012-01-09 13:07:25 -0800
commit0b113f7cdf5228dccd51a749a339c8669e3f20ff (patch)
tree5fe6eb1f0b7b79194e6c5f7fdb9604b5a948068b /dix
parent0b2c6491c5e5e1c9ba067299f3de61f5acee263b (diff)
parent777bf90abeac37087a3d0538b847742523d5acf2 (diff)
Diffstat (limited to 'dix')
-rw-r--r--dix/dispatch.c26
-rw-r--r--dix/dixutils.c7
2 files changed, 21 insertions, 12 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 048dff652..b91b41f4a 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -425,9 +425,11 @@ Dispatch(void)
client->minorOp = ext->MinorOpcode(client);
}
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_START(LookupMajorName(client->majorOp), client->majorOp,
- ((xReq *)client->requestBuffer)->length,
- client->index, client->requestBuffer);
+ if (XSERVER_REQUEST_START_ENABLED())
+ XSERVER_REQUEST_START(LookupMajorName(client->majorOp),
+ client->majorOp,
+ ((xReq *)client->requestBuffer)->length,
+ client->index, client->requestBuffer);
#endif
if (result > (maxBigRequestSize << 2))
result = BadLength;
@@ -438,8 +440,10 @@ Dispatch(void)
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), client->majorOp,
- client->sequence, client->index, result);
+ if (XSERVER_REQUEST_DONE_ENABLED())
+ XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp),
+ client->majorOp, client->sequence,
+ client->index, result);
#endif
if (client->noClientException != Success)
@@ -3578,12 +3582,14 @@ ProcInitialConnection(ClientPtr client)
REQUEST(xReq);
xConnClientPrefix *prefix;
int whichbyte = 1;
+ char order;
prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
- if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
+ order = prefix->byteOrder;
+ if (order != 'l' && order != 'B' && order != 'r' && order != 'R')
return client->noClientException = -1;
- if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l')))
+ if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r')))
{
client->swapped = TRUE;
SwapConnClientPrefix(prefix);
@@ -3595,6 +3601,10 @@ ProcInitialConnection(ClientPtr client)
{
swaps(&stuff->length);
}
+ if (order == 'r' || order == 'R')
+ {
+ client->local = FALSE;
+ }
ResetCurrentRequest(client);
return Success;
}
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 00bbde67c..2b5391f2d 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
int rc;
*pDraw = NULL;
- client->errorValue = id;
-
- if (id == INVALID)
- return BadDrawable;
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
+ if (rc != Success)
+ client->errorValue = id;
+
if (rc == BadValue)
return BadDrawable;
if (rc != Success)