diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-10-11 13:02:27 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-06 10:48:32 +1000 |
commit | aad65415bff12c6860c19beac42e4165e598a40f (patch) | |
tree | 3dbeb7cae2a8f7dea5c11f48c8b138c40b0f0fcd /dix | |
parent | 5b7384a3154a95a805b040e1910e276b52aada96 (diff) |
dix: don't allow disabling XTest devices
Disabling a XTest device followed by an XTest API call crashes the server.
This could be fixed elsewhere but disabled devices must not send events
anyway. The use-case for disabled XTest devices is somewhat limited, so
simply disallow disabling the devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/devices.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dix/devices.c b/dix/devices.c index fd4916a3a..613323fa2 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -145,9 +145,11 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) return BadValue; - /* Don't allow disabling of VCP/VCK */ - if ((dev == inputInfo.pointer ||dev == - inputInfo.keyboard) &&!(*(CARD8 *) prop->data)) + /* Don't allow disabling of VCP/VCK or XTest devices */ + if ((dev == inputInfo.pointer || + dev == inputInfo.keyboard || + IsXTestDevice(dev, NULL)) + &&!(*(CARD8 *) prop->data)) return BadAccess; if (!checkonly) { |