xserver: Branch 'mpx'

Peter Hutterer whot at kemper.freedesktop.org
Thu Oct 4 19:56:06 PDT 2007


 dix/devices.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
diff-tree ff2351246da30b56a3a8f90654993c41b8eb3921 (from ab88cb8d2e7c1410f9ed2be928b38f176b132e11)
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Fri Oct 5 12:19:03 2007 +0930

    dix: When pairing, only check for access right if client is set.
    
    If the pairing client is not set, then the pairing is initiated internally
    (e.g. when a new keyboard device is configured). In this case we _must_ pair
    regardless of who is the pairing client.

diff --git a/dix/devices.c b/dix/devices.c
index 24eaa4b..7cf82ee 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2184,6 +2184,9 @@ ProcQueryKeymap(ClientPtr client)
 
 /* Pair the keyboard to the pointer device. Keyboard events will follow the
  * pointer sprite. 
+ * If the client is set, the request to pair comes from some client. In this
+ * case, we need to check for access. If the client is NULL, it's from an
+ * internal automatic pairing, we must always permit this.
  */
 int 
 PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
@@ -2193,7 +2196,7 @@ PairDevices(ClientPtr client, DeviceIntP
 
     if (!pairingClient)
         RegisterPairingClient(client);
-    else if (pairingClient != client)
+    else if (client && pairingClient != client)
         return BadAccess;
 
     if (kbd->spriteInfo->spriteOwner)


More information about the xorg-commit mailing list