mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-23 06:43:07 +00:00
Xi: Fix XIPassiveGrab handling of keycodes > 255
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / xserver-build-netbsd (push) Waiting to run
Build X servers / xserver-build-cygwin (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / xserver-build-netbsd (push) Waiting to run
Build X servers / xserver-build-cygwin (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
This was fixed in commit51eb63b0eebut woefully badly. Instead of returning XIAlreadyGrabbed via the Reply, it simply returned the value from the request handler - causing the server to interpret it as BadRequest. Fix it and do what we intended to do instead. Fixes:51eb63b0ee("Xi: disallow passive grabs with a detail > 255") Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2186> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
6e2ee6ab51
commit
10d2d1a7ae
1 changed files with 9 additions and 6 deletions
|
|
@ -125,12 +125,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
return BadValue;
|
||||
}
|
||||
|
||||
/* XI2 allows 32-bit keycodes but thanks to XKB we can never
|
||||
* implement this. Just return an error for all keycodes that
|
||||
* cannot work anyway, same for buttons > 255. */
|
||||
if (stuff->detail > 255)
|
||||
return XIAlreadyGrabbed;
|
||||
|
||||
if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1],
|
||||
stuff->mask_len * 4) != Success)
|
||||
return BadValue;
|
||||
|
|
@ -185,6 +179,14 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++) {
|
||||
uint8_t status = Success;
|
||||
|
||||
/* XI2 allows 32-bit keycodes but thanks to XKB we can never
|
||||
* implement this. Pretend that all keycodes above 255 are
|
||||
* already grabbed, same for buttons > 255. */
|
||||
if (stuff->detail > 255) {
|
||||
status = XIAlreadyGrabbed;
|
||||
goto modifier_done;
|
||||
}
|
||||
|
||||
param.modifiers = *modifiers;
|
||||
ret = CheckGrabValues(client, ¶m);
|
||||
if (ret != Success)
|
||||
|
|
@ -217,6 +219,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
break;
|
||||
}
|
||||
|
||||
modifier_done:
|
||||
if (status != GrabSuccess) {
|
||||
/* write xXIGrabModifierInfo */
|
||||
x_rpcbuf_write_CARD32(&rpcbuf, *modifiers);
|
||||
|
|
|
|||
Loading…
Reference in a new issue