[Xquartz-changes] xserver: Branch 'server-1.7-apple' - 10 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Nov 23 22:33:36 PST 2009


 configure.ac                          |    4 +--
 dix/devices.c                         |    2 -
 hw/xfree86/common/xf86Events.c        |    5 ++--
 hw/xfree86/common/xf86Init.c          |    4 ++-
 hw/xfree86/loader/loadmod.c           |    7 ++++--
 hw/xquartz/mach-startup/bundle-main.c |   36 ++++++++++++++++++++--------------
 hw/xquartz/mach-startup/stub.c        |    1 
 hw/xwin/winmouse.c                    |    2 -
 hw/xwin/winprocarg.c                  |    4 +--
 os/access.c                           |    3 +-
 randr/randrstr.h                      |   12 ++++++++---
 11 files changed, 51 insertions(+), 29 deletions(-)

New commits:
commit b466329c111c4b6696508b3c2c8a60c9fbc90157
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon Nov 23 16:33:00 2009 -0800

    XQuartz: Allow better compatability with older versions of xinit
    
    If we are id="org.x" and the launchd socket is ":0", we will claim
    the socket to match the old behavior before we prefixed the
    socket name with our id.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 4677b5a80025b50ba2a3e953fd487a549586ae9f)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 640a91f..0366f3b 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -333,8 +333,10 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
     /* If we didn't get handed a launchd DISPLAY socket, we should
      * unset DISPLAY or we can run into problems with pbproxy
      */
-    if(!launchd_socket_handed_off)
+    if(!launchd_socket_handed_off) {
+        fprintf(stderr, "X11.app: No launchd socket handed off, unsetting DISPLAY\n");
         unsetenv("DISPLAY");
+    }
     
     if(!_argv || !_envp) {
         return KERN_FAILURE;
@@ -473,7 +475,7 @@ static void setup_env(void) {
 
     server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
     if(!server_bootstrap_name) {
-        fprintf(stderr, "Memory allocation error.\n");
+        fprintf(stderr, "X11.app: Memory allocation error.\n");
         exit(1);
     }
     strcpy(server_bootstrap_name, pds);
@@ -482,7 +484,7 @@ static void setup_env(void) {
     len = strlen(server_bootstrap_name);
     launchd_id_prefix = malloc(sizeof(char) * (len - 3));
     if(!launchd_id_prefix) {
-        fprintf(stderr, "Memory allocation error.\n");
+        fprintf(stderr, "X11.app: Memory allocation error.\n");
         exit(1);
     }
     strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
@@ -497,21 +499,27 @@ static void setup_env(void) {
         }
 
         if(s && *s) {
-            temp = (char *)malloc(sizeof(char) * len);
-            if(!temp) {
-                fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
-                exit(1);
-            }
-            strlcpy(temp, launchd_id_prefix, len);
-            strlcat(temp, ":0", len);
+            if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
+                fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
+            } else {
+                temp = (char *)malloc(sizeof(char) * len);
+                if(!temp) {
+                    fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n");
+                    exit(1);
+                }
+                strlcpy(temp, launchd_id_prefix, len);
+                strlcat(temp, ":0", len);
             
-            if(strcmp(temp, s) != 0) {
-                /* If we don't have a match, unset it. */
-                unsetenv("DISPLAY");
+                if(strcmp(temp, s) != 0) {
+                    /* If we don't have a match, unset it. */
+                    fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix);
+                    unsetenv("DISPLAY");
+                }
+                free(temp);
             }
-            free(temp);
         } else {
             /* The DISPLAY environment variable is not formatted like a launchd socket, so reset. */
+            fprintf(stderr, "X11.app: DISPLAY does not look like a launchd set variable, unsetting.\n");
             unsetenv("DISPLAY");
         }
     }
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 8f67035..af1c59e 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -232,6 +232,7 @@ int main(int argc, char **argv, char **envp) {
 
     kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
     if(kr != KERN_SUCCESS) {
+        fprintf(stderr, "Xquartz: Unable to locate waiting server: %s\n", server_bootstrap_name);
         pid_t child;
         set_x11_path();
 
commit 19b24f014f4dad1cc73e2454d15c64ae05ac8ef2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Nov 20 15:29:05 2009 +1000

    xserver 1.7.1.902
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 29e7da8..cfe8e59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.1.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-11-6"
+AC_INIT([xorg-server], 1.7.1.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2009-11-20"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit bebf7b1a342eaa37849a5b373bd1a507052233a8
Author: Julien Cristau <jcristau at debian.org>
Date:   Sat Nov 14 18:39:00 2009 +0100

    xfree86: set a sane umask before opening the log
    
    Xorg creates its log file following the umask of the user running
    startx, which may result in a world-writable log.  Set umask to 022 to
    prevent this.
    
    Debian bug#555308 <http://bugs.debian.org/555308>
    See also http://thread.gmane.org/gmane.comp.security.oss.general/2299
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 30be7ceaf228497ac1ff0a1123c1b35e3aa1fc73)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index c9baff3..d3de670 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1142,8 +1142,10 @@ OsVendorInit(void)
   signal(SIGCHLD, SIG_DFL);	/* Need to wait for child processes */
 #endif
 
-  if (!beenHere)
+  if (!beenHere) {
+    umask(022);
     xf86LogInit();
+  }
 
         /* Set stderr to non-blocking. */
 #ifndef O_NONBLOCK
commit e6872c89bcb8a0308cf83089194051e0ef69fba9
Author: Chase Douglas <chasedouglas at gmail.com>
Date:   Mon Nov 9 22:54:39 2009 -0500

    Move FD_CLR above pInfo->read_input
    
    The event fd may be invalidated by the pInfo->read_input call. If it is
    invalidated, the subsequent FD_CLR call will segfault. Thus, the FD_CLR
    call must precede the pInfo->read_input call.
    
    Signed-off-by: Chase Douglas <chasedouglas at gmail.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b5aa2e0a5fe233dc883084a5026013472e85bca4)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 9487fe7..8cd765a 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -263,13 +263,14 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
 		    (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
 		    int sigstate = xf86BlockSIGIO();
 
-		    pInfo->read_input(pInfo);
-		    xf86UnblockSIGIO(sigstate);
 		    /*
 		     * Remove the descriptior from the set because more than one
 		     * device may share the same file descriptor.
 		     */
 		    FD_CLR(pInfo->fd, &devicesWithInput);
+
+		    pInfo->read_input(pInfo);
+		    xf86UnblockSIGIO(sigstate);
 		}
 		pInfo = pInfo->next;
 	    }
commit a2e4bcc2a02f86ca3c23ccf1b4abc2f1d3fa3218
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Nov 10 09:50:50 2009 +1000

    dix: increase default number of buttons to 10.
    
    Currently the XTEST device is limited to the same number of buttons the core
    device has. This breaks if a user has a mouse with more than 3 buttons
    connected and is using a core client to fake button 8+ presses.
    
    Rather than expecting all clients to fix themselves, just increase the
    default number of buttons to 10, which is somewhat a compromise. Ideally,
    the XTEST devices should adjust themselves to the highest number of buttons
    available on the slave devices (like the master pointers already do), but
    that's a taks for another day.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 982f6648fd29d085265bf6035c1bf4d1b2499316)

diff --git a/dix/devices.c b/dix/devices.c
index 7486827..395e19a 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -539,7 +539,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
 int
 CorePointerProc(DeviceIntPtr pDev, int what)
 {
-#define NBUTTONS 7
+#define NBUTTONS 10
 #define NAXES 2
     BYTE map[NBUTTONS + 1];
     int i = 0;
commit 2b9ad701967d6fd9c1d98e87ce94a806a05125e5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 1 18:19:14 2009 +0000

    Avoid a null dereference if IFF_BROADCAST is set but there is no broadcast address
    
    It seems that the getifaddrs() function can return interfaces with
    IFF_BROADCAST & IFF_UP set, but no broadcast address (at least
    under Cygwin 1.7, this seems to happen for v6 mapped v4 addresses)
    
    Avoid a null dereference if this ever happens
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    (cherry picked from commit 28eb61fc04811bb9bbb523e0a252933313bb16ce)

diff --git a/os/access.c b/os/access.c
index 8c5b50a..2a171fa 100644
--- a/os/access.c
+++ b/os/access.c
@@ -811,7 +811,8 @@ DefineSelf (int fd)
 		continue;
 #endif
 	    if ((ifr->ifa_flags & IFF_BROADCAST) &&
-		(ifr->ifa_flags & IFF_UP))
+		(ifr->ifa_flags & IFF_UP) &&
+                ifr->ifa_broadaddr)
 		broad_addr = *ifr->ifa_broadaddr;
 	    else
 		continue;
commit 71f4b404c0c5b4e8f41d779687e026efd580a988
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Nov 4 15:16:03 2009 +0000

    Xming: Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion()
    
    Add mouse motion events with flag POINTER_SCREEN in winEnqueueMotion(), as
    they are in screen coordindates and may need to be scaled to the axis range
    appropriately
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    (cherry picked from commit 019a601de6a8ae083852c2d384c814dcc7aeeb72)

diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index b537d32..3d25aeb 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -382,7 +382,7 @@ void winEnqueueMotion(int x, int y)
   valuators[0] = x;
   valuators[1] = y;
   nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
-			     POINTER_ABSOLUTE, 0, 2, valuators);
+			     POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
 
   for (i = 0; i < nevents; i++)
     mieqEnqueue(g_pwinPointer, events[i].event);
commit f0325c2f6007f358bcc7c2632476dd6370fa0919
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jun 19 21:12:55 2009 +0100

    Cygwin/X: Remove a couple of extraneous '\n' in logged version info
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    (cherry picked from commit 2a38f7c0dbc890e6408eee143d77719f265d583d)

diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index f20598d..56af643 100755
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -1514,8 +1514,8 @@ winLogVersionInfo (void)
 
   ErrorF ("Welcome to the XWin X Server\n");
   ErrorF ("Vendor: %s\n", VENDOR_STRING);
-  ErrorF ("Release: %d.%d.%d.%d (%d)\n\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT);
-  ErrorF ("Contact: %s\n\n", VENDOR_CONTACT);
+  ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT);
+  ErrorF ("Contact: %s\n", VENDOR_CONTACT);
 }
 
 /*
commit 20beb2580f33add2ca7911a6d9410422a1d3079b
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 9 11:12:22 2009 -0500

    randr: Fill in errorValue when verifying outputs/crtcs/modes
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit c7d1319872e0ae0b7d945e9af8c4027ee5aa2055)

diff --git a/randr/randrstr.h b/randr/randrstr.h
index af14374..975fe33 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -344,24 +344,30 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
     {\
 	int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
 	                                 RROutputType, client, a);\
-	if (rc != Success)\
+	if (rc != Success) {\
+	    client->errorValue = id;\
 	    return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;\
+	}\
     }
 
 #define VERIFY_RR_CRTC(id, ptr, a)\
     {\
 	int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
 	                                 RRCrtcType, client, a);\
-	if (rc != Success)\
+	if (rc != Success) {\
+	    client->errorValue = id;\
 	    return (rc == BadValue) ? RRErrorBase + BadRRCrtc : rc;\
+	}\
     }
 
 #define VERIFY_RR_MODE(id, ptr, a)\
     {\
 	int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
 	                                 RRModeType, client, a);\
-	if (rc != Success)\
+	if (rc != Success) {\
+	    client->errorValue = id;\
 	    return (rc == BadValue) ? RRErrorBase + BadRRMode : rc;\
+	}\
     }
 
 #define GetRRClient(pClient)    ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
commit 2db157924b582933c4b6897505e6f4170e23b56f
Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Oct 13 10:15:00 2009 +1000

    loader: actually stat something that has some chance of existing. (v2)
    
    FindModuleInSubdir seems to expect a / at the end of the subdir its
    finding for, so we add the / early, the stat will fail if its
    not a subdir, I'm leaving the S_ISDIR in just in case there is another
    reason it could return 0. This does look a bit silly in strace
    but it seems to work fine.
    
    I have a very intermittent issue where drivers loses its / that
    I've been seeing on/off for a while, this may or may not fix it.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit d85ab6b6483d6ca7d9d22298d05ed1fa3076b042)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 0b220f1..5b175a5 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -399,8 +399,11 @@ FindModuleInSubdir(const char *dirpath, const char *module)
     while ((direntry = readdir(dir))) {
         if (direntry->d_name[0] == '.')
             continue;
-        if ((stat(direntry->d_name, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) {
-            snprintf(tmpBuf, PATH_MAX, "%s/%s", dirpath, direntry->d_name);
+        snprintf(tmpBuf, PATH_MAX, "%s%s/", dirpath, direntry->d_name);
+	/* the stat with the appended / fails for normal files,
+	   and works for sub dirs fine, looks a bit strange in strace
+	   but does seem to work */
+        if ((stat(tmpBuf, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) {
             if ((ret = FindModuleInSubdir(tmpBuf, module)))
                 break;
             continue;


More information about the Xquartz-changes mailing list