xserver: Branch 'master' - 3 commits

Ben Byer bbyer at kemper.freedesktop.org
Wed Sep 5 20:35:03 PDT 2007


 configure.ac    |   14 ++++++++------
 os/connection.c |   15 +++++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)

New commits:
diff-tree f3f614cd01ae56d84d61b4f5c907c6edd7c8c6d3 (from bf1641b94cffa54b786e18eaeff3839d8790b9f2)
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Sep 5 20:34:00 2007 -0700

    Revert "configure.ac: exclude pci-access dependency from XDarwin"
    
    This reverts commit 20c6677d1b5f8d77325dd878ffa3df1d0fb01864.

diff --git a/configure.ac b/configure.ac
index 0d35d81..74a0aea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1304,6 +1304,8 @@ if test "x$XORG" = xyes -o "x$XGL" = xye
 dnl Check to see if dlopen is in default libraries (like Solaris, which
 dnl has it in libc), or if libdl is needed to get it.
 
+	PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
 	case $host_os in
@@ -1501,12 +1503,6 @@ return 0;}
 		;;
 	esac
 
-        if ! test "$XORG_OS" = "Darwin" ; then
-               PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
-               XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS"
-               XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
-        fi
-
 	if test "x$XORG_OS_PCI" = x ; then
 		XORG_OS_PCI=$XORG_OS
 	fi
diff-tree bf1641b94cffa54b786e18eaeff3839d8790b9f2 (from 71c21dea748ea0dcad758679c40ee39192d170f9)
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Sep 5 20:33:43 2007 -0700

    XDARWIN: Add launchd support
    
    This adds a bit of glue to configure.ac to support launchd detection;
    on OS X (or other platforms which choose to implement launchd), this allows
    the system to automagically start the Xserver as necessary to serve clients.

diff --git a/configure.ac b/configure.ac
index 44dbda4..0d35d81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1075,6 +1075,10 @@ XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
+if test "x$HAVE_LAUNCHD" = xyes; then
+   XSERVER_CFLAGS="$XSERVER_CFLAGS -DHAVE_LAUNCHD"
+fi
+
 # The Xorg binary needs to export symbols so that they can be used from modules
 # Some platforms require extra flags to do this.   gcc should set these flags
 # when -rdynamic is passed to it, other compilers/linkers may need to be added
diff --git a/os/connection.c b/os/connection.c
index d975f87..d1bc4d0 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -74,6 +74,9 @@ SOFTWARE.
 #define TRANS_SERVER
 #define TRANS_REOPEN
 #include <X11/Xtrans/Xtrans.h>
+#ifdef HAVE_LAUNCHD
+#include <X11/Xtrans/Xtransint.h>
+#endif
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
@@ -660,10 +663,21 @@ ClientAuthorized(ClientPtr client, 
     XID	 		auth_id;
     char	 	*reason = NULL;
     XtransConnInfo	trans_conn;
+#ifdef HAVE_LAUNCHD
+    struct sockaddr     *saddr;
+#endif
 
     priv = (OsCommPtr)client->osPrivate;
     trans_conn = priv->trans_conn;
 
+#ifdef HAVE_LAUNCHD
+    saddr = (struct sockaddr *) (trans_conn->addr);
+    /* Allow any client to connect without authorization on a launchd socket,
+       because it is securely created -- this prevents a race condition on launch */
+    if (saddr->sa_len > 11 && saddr->sa_family == AF_UNIX &&
+        !strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done;
+#endif
+
     auth_id = CheckAuthorization (proto_n, auth_proto,
 				  string_n, auth_string, client, &reason);
 
@@ -719,6 +733,7 @@ ClientAuthorized(ClientPtr client, 
 	}
     }
     priv->auth_id = auth_id;
+ done:
     priv->conn_time = 0;
 
 #ifdef XDMCP
diff-tree 71c21dea748ea0dcad758679c40ee39192d170f9 (from 81c28ffd2b13a83770eadcfd7829d35d319d637f)
Author: Ben Byer <bbyer at bbyer.apple.com>
Date:   Wed Sep 5 18:45:50 2007 -0700

    added HAVE_LAUNCHD check to configure.ac (mostly for OSX)

diff --git a/configure.ac b/configure.ac
index 9c3ee99..44dbda4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,6 +95,8 @@ AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
 
+AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])


More information about the xorg-commit mailing list