diff options
author | marha <marha@users.sourceforge.net> | 2011-04-05 14:52:19 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-05 14:52:19 +0000 |
commit | 6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6 (patch) | |
tree | 02e0d5fd297602d526b582dc527e007fe20a326f /libxcb | |
parent | 1d142834bdb30308784a0654a39b7c0de7e37695 (diff) | |
parent | eaedc21febeadad4cf0e370f5d97e7bdb4470870 (diff) | |
download | vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.gz vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.bz2 vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.zip |
svn merge ^/branches/released .
Diffstat (limited to 'libxcb')
-rw-r--r-- | libxcb/configure.ac | 4 | ||||
-rw-r--r-- | libxcb/src/xcb_util.c | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/libxcb/configure.ac b/libxcb/configure.ac index f14c9b82e..cb518eaa2 100644 --- a/libxcb/configure.ac +++ b/libxcb/configure.ac @@ -106,6 +106,10 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_len], #include <sys/un.h>
])
+dnl check for support for Solaris Trusted Extensions
+AC_CHECK_HEADERS([tsol/label.h])
+AC_CHECK_FUNCS([is_system_labeled])
+
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c index e5b874e38..1c198c81f 100644 --- a/libxcb/src/xcb_util.c +++ b/libxcb/src/xcb_util.c @@ -54,6 +54,12 @@ #include "xcbext.h"
#include "xcbint.h"
+/* must be after "xcbint.h" to get autoconf #defines */
+#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
+# include <tsol/label.h>
+# include <sys/stat.h>
+#endif
+
#ifdef _MSC_VER
#ifdef close
#undef close
@@ -211,6 +217,21 @@ static int _xcb_open(const char *host, char *protocol, const int display) }
#ifndef _WIN32
+#if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
+ /* Check special path for Unix sockets under Solaris Trusted Extensions */
+ if (is_system_labeled())
+ {
+ struct stat sbuf;
+ const char *tsol_base = "/var/tsol/doors/.X11-unix/X";
+ char tsol_socket[PATH_MAX];
+
+ snprintf(tsol_socket, sizeof(tsol_socket), "%s%d", tsol_base, display);
+
+ if (stat(tsol_socket, &sbuf) == 0)
+ base = tsol_base;
+ }
+#endif
+
filelen = strlen(base) + 1 + sizeof(display) * 3 + 1;
file = malloc(filelen);
if(file == NULL)
|