xserver: Branch 'master' - 3 commits

Eamon Walsh ewalsh at kemper.freedesktop.org
Tue Jun 23 18:57:14 PDT 2009


 Xi/exevents.c           |    2 -
 Xi/grabdev.c            |    2 -
 Xi/grabdevb.c           |    4 +-
 Xi/grabdevk.c           |    4 +-
 Xi/listdev.c            |   80 ++++++++++++++++++++++++++++--------------------
 Xi/stubs.c              |    2 -
 Xi/xichangecursor.c     |    2 -
 Xi/xichangehierarchy.c  |   10 +++---
 Xi/xigetclientpointer.c |    2 -
 Xi/xiproperty.c         |   20 ++++++------
 Xi/xiquerydevice.c      |   55 +++++++++++++++++++++------------
 Xi/xiquerypointer.c     |    2 -
 Xi/xiselectev.c         |    8 ++--
 Xi/xisetclientpointer.c |    9 +++--
 Xi/xiwarppointer.c      |    4 +-
 dix/events.c            |   12 ++++---
 include/dix.h           |    2 -
 17 files changed, 128 insertions(+), 92 deletions(-)

New commits:
commit 84662e40c3d4141ebb298a1ad714f75056a4ab74
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Jun 18 23:19:21 2009 -0400

    Xi: check for GetAttr permission when listing or querying devices.
    
    If the check fails, leave the device off the returned list of info
    structures.  Under XI2, this may cause inconsistent views of the device
    topology after a change (for example, devices disappearing from view,
    or showing as attached to a master that cannot be seen).  More work is
    needed to deal with topology changes and device relabeling.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>

diff --git a/Xi/listdev.c b/Xi/listdev.c
index 95c1532..1c847fb 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -306,6 +306,25 @@ ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
     CopySwapClasses(client, d, &dev->num_classes, classbuf);
 }
 
+/***********************************************************************
+ *
+ * This procedure checks if a device should be left off the list.
+ *
+ */
+
+static Bool
+ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
+{
+    /* don't send master devices other than VCP/VCK */
+    if (!IsMaster(d) || d == inputInfo.pointer || d == inputInfo.keyboard)
+    {
+        int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
+        if (rc == Success)
+            return FALSE;
+    }
+    return TRUE;
+}
+
 
 /***********************************************************************
  *
@@ -323,12 +342,10 @@ ProcXListInputDevices(ClientPtr client)
     xListInputDevicesReply rep;
     int numdevs = 0;
     int namesize = 1;	/* need 1 extra byte for strcpy */
-    int rc, size = 0;
+    int i = 0, size = 0;
     int total_length;
-    char *devbuf;
-    char *classbuf;
-    char *namebuf;
-    char *savbuf;
+    char *devbuf, *classbuf, *namebuf, *savbuf;
+    Bool *skip;
     xDeviceInfo *dev;
     DeviceIntPtr d;
 
@@ -343,55 +360,51 @@ ProcXListInputDevices(ClientPtr client)
 
     AddOtherInputDevices();
 
-    for (d = inputInfo.devices; d; d = d->next) {
-        if (IsMaster(d) &&
-                d != inputInfo.pointer &&
-                d != inputInfo.keyboard)
-            continue; /* don't send master devices other than VCP/VCK */
+    /* allocate space for saving skip value */
+    skip = xcalloc(sizeof(Bool), inputInfo.numDevices);
+    if (!skip)
+        return BadAlloc;
+
+    /* figure out which devices to skip */
+    numdevs = 0;
+    for (d = inputInfo.devices; d; d = d->next, i++) {
+        skip[i] = ShouldSkipDevice(client, d);
+        if (skip[i])
+            continue;
 
-        rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
-        if (rc != Success)
-            return rc;
         SizeDeviceInfo(d, &namesize, &size);
         numdevs++;
     }
 
-    for (d = inputInfo.off_devices; d; d = d->next) {
-        if (IsMaster(d) &&
-                d != inputInfo.pointer &&
-                d != inputInfo.keyboard)
-            continue; /* don't send master devices other than VCP/VCK */
+    for (d = inputInfo.off_devices; d; d = d->next, i++) {
+        skip[i] = ShouldSkipDevice(client, d);
+        if (skip[i])
+            continue;
 
-        rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
-        if (rc != Success)
-            return rc;
         SizeDeviceInfo(d, &namesize, &size);
         numdevs++;
     }
 
+    /* allocate space for reply */
     total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
     devbuf = (char *)xcalloc(1, total_length);
     classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
     namebuf = classbuf + size;
     savbuf = devbuf;
 
+    /* fill in and send reply */
+    i = 0;
     dev = (xDeviceInfoPtr) devbuf;
-    for (d = inputInfo.devices; d; d = d->next)
-    {
-        if (IsMaster(d) &&
-                d != inputInfo.pointer &&
-                d != inputInfo.keyboard)
-            continue; /* don't count master devices other than VCP/VCK */
+    for (d = inputInfo.devices; d; d = d->next, i++) {
+        if (skip[i])
+            continue;
 
         ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
     }
 
-    for (d = inputInfo.off_devices; d; d = d->next)
-    {
-        if (IsMaster(d) &&
-                d != inputInfo.pointer &&
-                d != inputInfo.keyboard)
-            continue; /* don't count master devices other than VCP/VCK */
+    for (d = inputInfo.off_devices; d; d = d->next, i++) {
+        if (skip[i])
+            continue;
 
         ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
     }
@@ -400,6 +413,7 @@ ProcXListInputDevices(ClientPtr client)
     WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
     WriteToClient(client, total_length, savbuf);
     xfree(savbuf);
+    xfree(skip);
     return Success;
 }
 
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 6aa1685..33628a6 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -40,9 +40,11 @@
 #include "xkbsrv.h"
 #include "xserver-properties.h"
 #include "exevents.h"
+#include "xace.h"
 
 #include "xiquerydevice.h"
 
+static Bool ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr d);
 static int ListDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
 static int SizeDeviceInfo(DeviceIntPtr dev);
 static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
@@ -65,8 +67,9 @@ ProcXIQueryDevice(ClientPtr client)
     xXIQueryDeviceReply rep;
     DeviceIntPtr dev = NULL;
     int rc = Success;
-    int len = 0;
+    int i = 0, len = 0;
     char *info, *ptr;
+    Bool *skip = NULL;
 
     REQUEST(xXIQueryDeviceReq);
     REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
@@ -79,28 +82,27 @@ ProcXIQueryDevice(ClientPtr client)
             client->errorValue = stuff->deviceid;
             return rc;
         }
-    }
-
-    if (dev)
         len += SizeDeviceInfo(dev);
+    }
     else
     {
-        len = 0;
-        for (dev = inputInfo.devices; dev; dev = dev->next)
+        skip = xcalloc(sizeof(Bool), inputInfo.numDevices);
+        if (!skip)
+            return BadAlloc;
+
+        for (dev = inputInfo.devices; dev; dev = dev->next, i++)
         {
-            if (stuff->deviceid == XIAllDevices ||
-                (stuff->deviceid == XIAllMasterDevices && IsMaster(dev)))
+            skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev);
+            if (!skip[i])
                 len += SizeDeviceInfo(dev);
         }
 
-        for (dev = inputInfo.off_devices; dev; dev = dev->next)
+        for (dev = inputInfo.off_devices; dev; dev = dev->next, i++)
         {
-            if (stuff->deviceid == XIAllDevices ||
-                (stuff->deviceid == XIAllMasterDevices && IsMaster(dev)))
+            skip[i] = ShouldSkipDevice(client, stuff->deviceid, dev);
+            if (!skip[i])
                 len += SizeDeviceInfo(dev);
         }
-
-        dev = NULL;
     }
 
     info = xcalloc(1, len);
@@ -124,10 +126,10 @@ ProcXIQueryDevice(ClientPtr client)
         rep.num_devices = 1;
     } else
     {
-        for (dev = inputInfo.devices; dev; dev = dev->next)
+        i = 0;
+        for (dev = inputInfo.devices; dev; dev = dev->next, i++)
         {
-            if (stuff->deviceid == XIAllDevices ||
-                    (stuff->deviceid == XIAllMasterDevices && IsMaster(dev)))
+            if (!skip[i])
             {
                 len = ListDeviceInfo(dev, (xXIDeviceInfo*)info);
                 if (client->swapped)
@@ -137,10 +139,9 @@ ProcXIQueryDevice(ClientPtr client)
             }
         }
 
-        for (dev = inputInfo.off_devices; dev; dev = dev->next)
+        for (dev = inputInfo.off_devices; dev; dev = dev->next, i++)
         {
-            if (stuff->deviceid == XIAllDevices ||
-                    (stuff->deviceid == XIAllMasterDevices && IsMaster(dev)))
+            if (!skip[i])
             {
                 len = ListDeviceInfo(dev, (xXIDeviceInfo*)info);
                 if (client->swapped)
@@ -154,6 +155,7 @@ ProcXIQueryDevice(ClientPtr client)
     WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
     WriteToClient(client, rep.length * 4, ptr);
     xfree(ptr);
+    xfree(skip);
     return rc;
 }
 
@@ -172,6 +174,21 @@ SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
 }
 
 
+/**
+ * @return Whether the device should be included in the returned list.
+ */
+static Bool
+ShouldSkipDevice(ClientPtr client, int deviceid, DeviceIntPtr dev)
+{
+    /* if all devices are not being queried, only master devices are */
+    if (deviceid == XIAllDevices || IsMaster(dev))
+    {
+        int rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
+        if (rc == Success)
+            return FALSE;
+    }
+    return TRUE;
+}
 
 /**
  * @return The number of bytes needed to store this device's xXIDeviceInfo
commit 00bc8d34c68dab6c818cd1c7e03e9992d1d0cbfc
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Jun 18 21:41:17 2009 -0400

    Xi: check for Use permission on the device in SetClientPointer().
    
    Presumably, some intelligent, XI2-aware management app will be calling
    XISetClientPointer on behalf of other clients; this check makes sure
    the target client has permission on the device.
    
    Requires changing the prototype to return status code instead of Bool.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c
index 2736185..09db8ff 100644
--- a/Xi/xisetclientpointer.c
+++ b/Xi/xisetclientpointer.c
@@ -98,10 +98,11 @@ ProcXISetClientPointer(ClientPtr client)
     } else
         targetClient = client;
 
-    if (!SetClientPointer(targetClient, pDev))
+    rc = SetClientPointer(targetClient, pDev);
+    if (rc != Success)
     {
         client->errorValue = stuff->deviceid;
-        return BadDevice;
+        return rc;
     }
 
     return Success;
diff --git a/dix/events.c b/dix/events.c
index 43e1bd2..81e5b6d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5699,21 +5699,25 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
  * PickPointer()).
  * If a keyboard is needed, the first keyboard paired with the CP is used.
  */
-Bool
+int
 SetClientPointer(ClientPtr client, DeviceIntPtr device)
 {
+    int rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixUseAccess);
+    if (rc != Success)
+	return rc;
+
     if (!IsMaster(device))
     {
         ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n");
-        return FALSE;
+        return BadDevice;
     } else if (!device->spriteInfo->spriteOwner)
     {
         ErrorF("[dix] Device %d does not have a sprite. "
                 "Cannot be ClientPointer\n", device->id);
-        return FALSE;
+        return BadDevice;
     }
     client->clientPtr = device;
-    return TRUE;
+    return Success;
 }
 
 /* PickPointer will pick an appropriate pointer for the given client.
diff --git a/include/dix.h b/include/dix.h
index c4a6394..c6e52e7 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -485,7 +485,7 @@ extern _X_EXPORT int TryClientEvents(
 
 extern _X_EXPORT void WindowsRestructured(void);
 
-extern Bool SetClientPointer(
+extern int SetClientPointer(
         ClientPtr /* client */,
         DeviceIntPtr /* device */);
 
commit 119b96667778391436998c76a68bf64e746c9e08
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Thu Jun 18 21:02:28 2009 -0400

    Xi: fix up access modes for calls to dixLookupDevice().
    
    New access modes are being passed to the device access hook for XI2:
    DixCreateAccess for creating a new master device;
    DixAdd/RemoveAccess for attaching/removing slave devices to a master; and
    DixListProp/GetProp/SetPropAccess for device properties.
    
    Refer to the XACE-Spec document in xorg-docs, section "Device Access."
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index e54af09..34fdf50 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -2000,7 +2000,7 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
     DeviceIntPtr dev;
 
     dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient,
-		    DixReadAccess);
+		    DixGrabAccess);
     if (!dev)
         return;
 
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index adcd7e7..e1d430a 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -184,7 +184,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
 	if (device > 255) /* FIXME: we only use 7 bit for devices? */
 	    return BadClass;
 
-	rc = dixLookupDevice(&tdev, device, client, DixReadAccess);
+	rc = dixLookupDevice(&tdev, device, client, DixUseAccess);
 	if (rc != BadDevice && rc != Success)
 	    return rc;
 	if (rc == BadDevice || (dev != NULL && tdev != dev))
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index 7cd5cc4..58fb73b 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -119,14 +119,14 @@ ProcXGrabDeviceButton(ClientPtr client)
 
     if (stuff->modifier_device != UseXKeyboard) {
 	ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
-			      DixReadAccess);
+			      DixUseAccess);
 	if (ret != Success)
 	    return ret;
 	if (mdev->key == NULL)
 	    return BadMatch;
     } else {
 	mdev = PickKeyboard(client);
-	ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
+	ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
 	if (ret != Success)
 	    return ret;
     }
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index 5ffecd2..9ae38f0 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.c
@@ -116,14 +116,14 @@ ProcXGrabDeviceKey(ClientPtr client)
 
     if (stuff->modifier_device != UseXKeyboard) {
 	ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
-			      DixReadAccess);
+			      DixUseAccess);
 	if (ret != Success)
 	    return ret;
 	if (mdev->key == NULL)
 	    return BadMatch;
     } else {
 	mdev = PickKeyboard(client);
-	ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
+	ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
 	if (ret != Success)
 	    return ret;
     }
diff --git a/Xi/stubs.c b/Xi/stubs.c
index 229394b..400e937 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -153,7 +153,7 @@ AddOtherInputDevices(void)
 void
 OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
 {
-    *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess);
+    *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess);
 }
 
 /****************************************************************************
diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
index 7517d2c..dc33d70 100644
--- a/Xi/xichangecursor.c
+++ b/Xi/xichangecursor.c
@@ -95,7 +95,7 @@ int ProcXIChangeCursor(ClientPtr client)
     else
     {
 	rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor,
-				     RT_CURSOR, client, DixReadAccess);
+				     RT_CURSOR, client, DixUseAccess);
 	if (rc != Success)
 	    return (rc == BadValue) ? BadCursor : rc;
     }
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 5401554..917a0d7 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -340,7 +340,7 @@ ProcXIChangeHierarchy(ClientPtr client)
                                      newkeybd;
 
                         rc = dixLookupDevice(&newptr, r->return_pointer,
-                                             client, DixWriteAccess);
+                                             client, DixAddAccess);
                         if (rc != Success)
                             goto unwind;
 
@@ -352,7 +352,7 @@ ProcXIChangeHierarchy(ClientPtr client)
                         }
 
                         rc = dixLookupDevice(&newkeybd, r->return_keyboard,
-                                             client, DixWriteAccess);
+                                             client, DixAddAccess);
                         if (rc != Success)
                             goto unwind;
 
@@ -415,7 +415,7 @@ ProcXIChangeHierarchy(ClientPtr client)
                     DeviceIntPtr *xtstdevice;
 
                     rc = dixLookupDevice(&ptr, c->deviceid, client,
-                                          DixWriteAccess);
+                                          DixManageAccess);
                     if (rc != Success)
                        goto unwind;
 
@@ -448,7 +448,7 @@ ProcXIChangeHierarchy(ClientPtr client)
                     DeviceIntPtr *xtstdevice;
 
                     rc = dixLookupDevice(&ptr, c->deviceid, client,
-                                          DixWriteAccess);
+                                          DixManageAccess);
                     if (rc != Success)
                        goto unwind;
 
@@ -471,7 +471,7 @@ ProcXIChangeHierarchy(ClientPtr client)
                     }
 
                     rc = dixLookupDevice(&newmaster, c->new_master,
-                            client, DixWriteAccess);
+                            client, DixAddAccess);
                     if (rc != Success)
                         goto unwind;
                     if (!IsMaster(newmaster))
diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c
index 859d3fd..401e89f 100644
--- a/Xi/xigetclientpointer.c
+++ b/Xi/xigetclientpointer.c
@@ -68,7 +68,7 @@ int ProcXIGetClientPointer(ClientPtr client)
     if (stuff->win != None)
     {
         rc = dixLookupClient(&winclient, stuff->win, client,
-                DixWriteAccess);
+                DixGetAttrAccess);
 
         if (rc != Success)
             return BadWindow;
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index cd49460..396061f 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -858,7 +858,7 @@ ProcXListDeviceProperties (ClientPtr client)
     REQUEST(xListDevicePropertiesReq);
     REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
 
-    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess);
+    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
     if (rc != Success)
         return rc;
 
@@ -894,7 +894,7 @@ ProcXChangeDeviceProperty (ClientPtr client)
     REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
     UpdateCurrentTime();
 
-    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
+    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
     if (rc != Success)
         return rc;
 
@@ -922,7 +922,7 @@ ProcXDeleteDeviceProperty (ClientPtr client)
 
     REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
     UpdateCurrentTime();
-    rc =  dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
+    rc =  dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
     if (rc != Success)
         return rc;
 
@@ -951,8 +951,8 @@ ProcXGetDeviceProperty (ClientPtr client)
     if (stuff->delete)
         UpdateCurrentTime();
     rc = dixLookupDevice (&dev, stuff->deviceid, client,
-                           stuff->delete ? DixWriteAccess :
-                           DixReadAccess);
+                           stuff->delete ? DixSetPropAccess :
+                           DixGetPropAccess);
     if (rc != Success)
         return rc;
 
@@ -1102,7 +1102,7 @@ ProcXIListProperties(ClientPtr client)
     REQUEST(xXIListPropertiesReq);
     REQUEST_SIZE_MATCH(xXIListPropertiesReq);
 
-    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixReadAccess);
+    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
     if (rc != Success)
         return rc;
 
@@ -1138,7 +1138,7 @@ ProcXIChangeProperty(ClientPtr client)
     REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
     UpdateCurrentTime();
 
-    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
+    rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
     if (rc != Success)
         return rc;
 
@@ -1165,7 +1165,7 @@ ProcXIDeleteProperty(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
     UpdateCurrentTime();
-    rc =  dixLookupDevice (&dev, stuff->deviceid, client, DixWriteAccess);
+    rc =  dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
     if (rc != Success)
         return rc;
 
@@ -1195,8 +1195,8 @@ ProcXIGetProperty(ClientPtr client)
     if (stuff->delete)
         UpdateCurrentTime();
     rc = dixLookupDevice (&dev, stuff->deviceid, client,
-                           stuff->delete ? DixWriteAccess :
-                           DixReadAccess);
+                           stuff->delete ? DixSetPropAccess :
+                           DixGetPropAccess);
     if (rc != Success)
         return rc;
 
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index e770e84..2222873 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -91,7 +91,7 @@ ProcXIQueryPointer(ClientPtr client)
         return BadDevice;
     }
 
-    rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
+    rc = dixLookupWindow(&pWin, stuff->win, client, DixGetAttrAccess);
     if (rc != Success)
     {
         SendErrorToClient(client, IReqCode, X_XIQueryPointer,
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index a8763a2..750ae61 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -87,7 +87,7 @@ ProcXISelectEvents(ClientPtr client)
     {
         if (evmask->deviceid != XIAllDevices &&
             evmask->deviceid != XIAllMasterDevices)
-            rc = dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess);
+            rc = dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
         else {
             /* XXX: XACE here? */
         }
@@ -127,7 +127,7 @@ ProcXISelectEvents(ClientPtr client)
             dummy.id = evmask->deviceid;
             dev = &dummy;
         } else
-            dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess);
+            dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
         XISetEventMask(dev, win, client, evmask->mask_len * 4, (unsigned char*)&evmask[1]);
         evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
         evmask++;
@@ -169,7 +169,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
     REQUEST(xXIGetSelectedEventsReq);
     REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
 
-    rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
+    rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
 
@@ -208,7 +208,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
 
         if (i > 2)
         {
-            rc = dixLookupDevice(&dev, i, client, DixReadAccess);
+            rc = dixLookupDevice(&dev, i, client, DixGetAttrAccess);
             if (rc != Success)
                 continue;
         }
diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c
index afc13d6..2736185 100644
--- a/Xi/xisetclientpointer.c
+++ b/Xi/xisetclientpointer.c
@@ -72,7 +72,7 @@ ProcXISetClientPointer(ClientPtr client)
     REQUEST_SIZE_MATCH(xXISetClientPointerReq);
 
 
-    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
+    rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess);
     if (rc != Success)
     {
         client->errorValue = stuff->deviceid;
@@ -90,7 +90,7 @@ ProcXISetClientPointer(ClientPtr client)
     if (stuff->win != None)
     {
         rc = dixLookupClient(&targetClient, stuff->win, client,
-                DixWriteAccess);
+                DixManageAccess);
 
         if (rc != Success)
             return BadWindow;
diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c
index 105c87a..bf361db 100644
--- a/Xi/xiwarppointer.c
+++ b/Xi/xiwarppointer.c
@@ -85,7 +85,7 @@ ProcXIWarpPointer(ClientPtr client)
 
     if (stuff->dst_win != None)
     {
-        rc = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
+        rc = dixLookupWindow(&dest, stuff->dst_win, client, DixGetAttrAccess);
         if (rc != Success)
         {
             return rc;
@@ -101,7 +101,7 @@ ProcXIWarpPointer(ClientPtr client)
         int winX, winY;
         WindowPtr src;
 
-        rc = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
+        rc = dixLookupWindow(&src, stuff->src_win, client, DixGetAttrAccess);
         if (rc != Success)
         {
             return rc;


More information about the xorg-commit mailing list