From c3f042de233e6ce375e470930b2b3a885ec63a93 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 25 Mar 2025 13:25:58 +0100 Subject: [PATCH] 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 --- Xi/xiselectev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 3e3ccdc58..85fae2774 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -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;