xace: add hooks + new access codes: core protocol client requests

This commit is contained in:
Eamon Walsh 2007-08-16 10:57:49 -04:00 committed by Eamon Walsh
parent 5bee8db003
commit e89301c879
2 changed files with 23 additions and 10 deletions

View File

@ -3519,9 +3519,14 @@ ProcGetFontPath(ClientPtr client)
int
ProcChangeCloseDownMode(ClientPtr client)
{
int rc;
REQUEST(xSetCloseDownModeReq);
REQUEST_SIZE_MATCH(xSetCloseDownModeReq);
rc = XaceHook(XACE_CLIENT_ACCESS, client, client, DixManageAccess);
if (rc != Success)
return rc;
if ((stuff->mode == AllTemporary) ||
(stuff->mode == RetainPermanent) ||
(stuff->mode == RetainTemporary))

View File

@ -254,17 +254,25 @@ _X_EXPORT int
dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
{
pointer pRes;
int clientIndex = CLIENT_ID(rid);
int rc = BadValue, clientIndex = CLIENT_ID(rid);
if (!clientIndex || !clients[clientIndex] || (rid & SERVER_BIT))
goto bad;
rc = dixLookupResource(&pRes, rid, RC_ANY, client, DixGetAttrAccess);
if (rc != Success)
goto bad;
rc = XaceHook(XACE_CLIENT_ACCESS, client, clients[clientIndex], access);
if (rc != Success)
goto bad;
*pClient = clients[clientIndex];
return Success;
bad:
client->errorValue = rid;
dixLookupResource(&pRes, rid, RC_ANY, client, access);
if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) {
*pClient = clients[clientIndex];
return Success;
}
*pClient = NULL;
return BadValue;
return rc;
}
int