summaryrefslogtreecommitdiff
path: root/Xi/setmode.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-02-26 12:34:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-07 09:40:44 +1000
commitdce40e2266200421647044ec7e856656d2ef952d (patch)
tree2ab459bb8842ec91d377d5dbd072338920624c78 /Xi/setmode.c
parent23d1bc69f305edd5a6e2cfec3dfc84befda0881c (diff)
Xi: always return BadMatch for XTest devices ChangeDeviceControl requests
The only controls that still do something are DEVICE_RESOLUTION and DEVICE_ENABLE. XTest devices have no resolution to change, and they cannot be disabled. So skip the lot, and prevent a crash in the DDX when it's trying to de-reference pInfo->control_proc on device with no pInfo struct. Likewise, don't allow setting device mode or the valuators. XTest pointers are always relative, they don't have a mode. Test cases: xts5/XI/ChangeDeviceControl (1/10) xts5/XI/SetDeviceValuators (1/6) and a few others Reported-by: Knut Petersen <Knut_Petersen@t-online.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xi/setmode.c')
-rw-r--r--Xi/setmode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Xi/setmode.c b/Xi/setmode.c
index 535655257..5ed09136e 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -104,6 +104,10 @@ ProcXSetDeviceMode(ClientPtr client)
return rc;
if (dev->valuator == NULL)
return BadMatch;
+
+ if (IsXTestDevice(dev, NULL))
+ return BadMatch;
+
if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
rep.status = AlreadyGrabbed;
else