We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4926

Summary: X11: does not work for untrusted clients
Product: SDL Reporter: Dmitry Levin <sdl.dl>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.10   
Hardware: All   
OS: Linux   
Attachments: SDL2-2.0.10-alt-X11_InitKeyboard.patch

Description Dmitry Levin 2020-01-04 13:03:15 UTC
Created attachment 4150 [details]
SDL2-2.0.10-alt-X11_InitKeyboard.patch

X11_InitKeyboard invokes XAutoRepeatOn unconditionally, but, unfortunately, this does not work for untrusted X11 clients, e.g. in case of untrusted X11 forwarding.

The fix is to avoid XAutoRepeatOn invocation when global_auto_repeat is already equal to AutoRepeatModeOn (which is the default).
Proposed patch is attached.
Comment 1 Sam Lantinga 2020-01-04 19:06:42 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/f350dadd5ad1

FYI, that member initialization syntax doesn't work with all supported compilers.