diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2006-12-15 17:26:58 -0500 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-huskies.epoch.ncsc.mil> | 2006-12-15 17:26:58 -0500 |
commit | ab1d5b0c31a1cfce95ab6b1d06f209f2c44e19ac (patch) | |
tree | 50eebcf74cd3902b90af50ebf60376821da58725 | |
parent | f11dafaafc68f5cff1a1538d9566907786d8ab72 (diff) |
Convert callers of LookupClient() to dixLookupClient().
-rw-r--r-- | Xext/appgroup.c | 7 | ||||
-rw-r--r-- | Xext/sync.c | 20 | ||||
-rw-r--r-- | dix/dispatch.c | 12 | ||||
-rw-r--r-- | dix/dixutils.c | 5 | ||||
-rw-r--r-- | include/dix.h | 3 |
5 files changed, 27 insertions, 20 deletions
diff --git a/Xext/appgroup.c b/Xext/appgroup.c index 134b172f9..bb7a73ce1 100644 --- a/Xext/appgroup.c +++ b/Xext/appgroup.c @@ -485,10 +485,13 @@ int ProcXagQuery( ClientPtr pClient; AppGroupPtr pAppGrp; REQUEST (xXagQueryReq); - int n; + int n, rc; REQUEST_SIZE_MATCH (xXagQueryReq); - pClient = LookupClient (stuff->resource, client); + rc = dixLookupClient(&pClient, stuff->resource, client, DixUnknownAccess); + if (rc != Success) + return rc; + for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next) for (n = 0; n < pAppGrp->nclients; n++) if (pAppGrp->clients[n] == pClient) { diff --git a/Xext/sync.c b/Xext/sync.c index 1d899348b..531b48cc1 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1452,15 +1452,17 @@ ProcSyncSetPriority(client) { REQUEST(xSyncSetPriorityReq); ClientPtr priorityclient; + int rc; REQUEST_SIZE_MATCH(xSyncSetPriorityReq); if (stuff->id == None) priorityclient = client; - else if (!(priorityclient = LookupClient(stuff->id, client))) - { - client->errorValue = stuff->id; - return BadMatch; + else { + rc = dixLookupClient(&priorityclient, stuff->id, client, + DixUnknownAccess); + if (rc != Success) + return rc; } if (priorityclient->priority != stuff->priority) @@ -1487,15 +1489,17 @@ ProcSyncGetPriority(client) REQUEST(xSyncGetPriorityReq); xSyncGetPriorityReply rep; ClientPtr priorityclient; + int rc; REQUEST_SIZE_MATCH(xSyncGetPriorityReq); if (stuff->id == None) priorityclient = client; - else if (!(priorityclient = LookupClient(stuff->id, client))) - { - client->errorValue = stuff->id; - return BadMatch; + else { + rc = dixLookupClient(&priorityclient, stuff->id, client, + DixUnknownAccess); + if (rc != Success) + return rc; } rep.type = X_Reply; diff --git a/dix/dispatch.c b/dix/dispatch.c index 3060a4c39..51ad07da5 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3388,7 +3388,8 @@ int ProcKillClient(register ClientPtr client) { REQUEST(xResourceReq); - ClientPtr killclient; + ClientPtr killclient; + int rc; REQUEST_SIZE_MATCH(xResourceReq); if (stuff->id == AllTemporary) @@ -3397,8 +3398,8 @@ ProcKillClient(register ClientPtr client) return (client->noClientException); } - if ((killclient = LookupClient(stuff->id, client))) - { + rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); + if (rc == Success) { CloseDownClient(killclient); /* if an LBX proxy gets killed, isItTimeToYield will be set */ if (isItTimeToYield || (client == killclient)) @@ -3412,10 +3413,7 @@ ProcKillClient(register ClientPtr client) return (client->noClientException); } else - { - client->errorValue = stuff->id; - return (BadValue); - } + return rc; } int diff --git a/dix/dixutils.c b/dix/dixutils.c index 3479ddccf..2859b96e9 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -262,11 +262,12 @@ dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access) } _X_EXPORT int -dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client) +dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) { pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY, DixReadAccess); int clientIndex = CLIENT_ID(rid); + client->errorValue = rid; if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) { *pClient = clients[clientIndex]; @@ -312,7 +313,7 @@ _X_EXPORT ClientPtr LookupClient(XID id, ClientPtr client) { ClientPtr pClient; - int i = dixLookupClient(&pClient, id, client); + int i = dixLookupClient(&pClient, id, client, DixUnknownAccess); return (i == Success) ? pClient : NULL; } diff --git a/include/dix.h b/include/dix.h index baff43f54..5c2c5b862 100644 --- a/include/dix.h +++ b/include/dix.h @@ -301,7 +301,8 @@ extern int dixLookupGC( extern int dixLookupClient( ClientPtr *result, XID id, - ClientPtr client); + ClientPtr client, + Mask access_mode); /* * These are deprecated compatibility functions and will be removed soon! |