summaryrefslogtreecommitdiff
path: root/Xi/opendev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-28 10:26:01 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-28 10:26:01 +0930
commitb5004722a208479a4bc762ff428bf4cbeb430d53 (patch)
tree2d609b20387cfe3ae035bf1e75c96fac0ec8a42b /Xi/opendev.c
parent684b5d8382bf0bc6cd55774226ee362e81c0adbf (diff)
Xi: Only return VCP, VCK and floating SDs to Xi 1.x clients.
This is better than the approach implemented with 8973a3f7983240407dd6da59b3643f40e6a3d83a which disabled XI altogether for 1.x. Instead, return a device list that resembles a traditional XI setup on pre XI 2.0 servers. If the client tries to open a device other than a floating SD, return a BadDevice error.
Diffstat (limited to 'Xi/opendev.c')
-rw-r--r--Xi/opendev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/Xi/opendev.c b/Xi/opendev.c
index f14f848bf..c51bb7e3f 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -62,6 +62,7 @@ SOFTWARE.
#include "XIstubs.h"
#include "windowstr.h" /* window structure */
#include "exglobals.h"
+#include "exevents.h"
#include "opendev.h"
@@ -98,6 +99,7 @@ ProcXOpenDevice(ClientPtr client)
int status = Success;
xOpenDeviceReply rep;
DeviceIntPtr dev;
+ XIClientPtr pXIClient;
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
@@ -113,6 +115,15 @@ ProcXOpenDevice(ClientPtr client)
} else if (status != Success)
return status;
+ /* Don't let XI 1.x clients open devices other than floating SDs. */
+ pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
+ if (pXIClient->major_version < XI_2_Major)
+ {
+ if (dev->isMaster || (!dev->isMaster && dev->u.master))
+ return BadDevice;
+ }
+
+
OpenInputDevice(dev, client, &status);
if (status != Success)
return status;