Xi: allow hooks to silently ignore SelectEvents request

When looking up the window to select on and security hook returns
BadAccess, the request is just silently ignored, instead of rejected.

This way, security hook can prevent untrusted clients to listen on
arbitrary windows, without the client even noticing. The client won't
get this BadAccess error, but instead thinking everything's fine,
just not getting the actual events.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-03-25 13:25:58 +01:00
parent 349d13961d
commit c3f042de23

View File

@ -161,6 +161,11 @@ ProcXISelectEvents(ClientPtr client)
return BadValue;
rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
// when access to the window is denied, just pretend everything's okay
if (rc == BadAccess)
return Success;
if (rc != Success)
return rc;