mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-30 21:53:25 +00:00
xace: add hooks + new access codes: core protocol client requests
This commit is contained in:
parent
5bee8db003
commit
e89301c879
2 changed files with 22 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue