Commit b3711a6c authored by Jérome Perrin's avatar Jérome Perrin

component/xorg: update patch to place lockfile/sockets in $XORG_LOCK_DIR

Update the patch not to use $TMPDIR, but to use an environment variable
dedicated for this purpose, because $TMPDIR has a different meaning.

With firefox 60, running `TMPDIR=/same/tmpdir/as/xvfb firefox --marionette` no
longer work and complains:

 Gtk-WARNING **: cannot open display: :0

If we investigate with strace we can see that marionette restarts with a
different $TMPDIR ( to store temporary files in another directory ) and we can see:

 connect(15, {sa_family=AF_UNIX, sun_path=@"/srv/slapgrid/slappart8/tmp/inst/TestRemoteDriver-0/tmp/Temp-0336e727-3485-4774-a816-75fda1baca12/.X11-unix"}, 113) = -1 EINVAL (Invalid argument)
 write(2, "\n(/srv/slapgrid/slappart8/tmp/soft/c5be5b0096cd286c70df5156590cf4f6/parts/firefox-60/firefox:29812): Gtk-\33[1;33mWARNING\33[0m **: cannot open display: :0\n", 152) = 152

To prevent this kind of problems, instead of using TMPDIR, use
a new dedicated environment variable XORG_LOCK_DIR.

No backward compatibility is provided, the profiles will be updated. In the
worst cases, non updated profiles will use /tmp/ and will work unless $DISPLAY
conflicts.
parent 078e3376
......@@ -17,6 +17,7 @@ extends =
../perl-XML-Parser/buildout.cfg
../pkgconfig/buildout.cfg
../zlib/buildout.cfg
./buildout.hash.cfg
parts =
libXdmcp
......@@ -67,7 +68,7 @@ shared = true
url = http://www.x.org/releases/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2
md5sum = 84c66908cf003ad8c272b0eecbdbaee3
patches =
${:_profile_base_location_}/xtrans_tmp_env.patch#37d82a3b6009113023599632117a6855
${:_profile_base_location_}/xtrans_tmp_env.patch#${xtrans_tmp_env.patch:md5sum}
patch-options = -p1
configure-options =
--disable-docs
......@@ -109,7 +110,7 @@ shared = true
url = http://xcb.freedesktop.org/dist/libxcb-1.9.1.tar.bz2
md5sum = ed632cb0dc31b6fbd7ea5c0f931cf5a4
patches =
${:_profile_base_location_}/libxcb_tmp_env.patch#61f39878120ba434a169e24cae2af862
${:_profile_base_location_}/libxcb_tmp_env.patch#${libxcb_tmp_env.patch:md5sum}
patch-options = -p1
configure-options =
--disable-static
......@@ -554,7 +555,7 @@ shared = true
url = http://www.x.org/releases/X11R7.7/src/everything/xorg-server-1.12.2.tar.bz2
md5sum = 791f0323b886abb7954de7f042bb7dc6
patches =
${:_profile_base_location_}/xorg-server_tmp_env.patch#8b60ab8121f0564a681fc00d03101696
${:_profile_base_location_}/xorg-server_tmp_env.patch#${xorg-server_tmp_env.patch:md5sum}
patch-options = -p1
configure-options =
--enable-xvfb
......
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[libxcb_tmp_env.patch]
filename = libxcb_tmp_env.patch
md5sum = 03bc7279f2a37bac7bf426af213123b2
[xorg-server_tmp_env.patch]
filename = xorg-server_tmp_env.patch
md5sum = 8ab5c57af8348787c119c1bafc3b1409
[xtrans_tmp_env.patch]
filename = xtrans_tmp_env.patch
md5sum = 3258214edaba0a52dc0c800f940a0b9f
Store Xorg lock files and sockets in different directories
see xorg-server_tmp_env.patch
--- libxcb-1.7/src/xcb_util.c.back 2012-04-03 13:30:36.000000000 +0200
+++ libxcb-1.7/src/xcb_util.c 2012-04-03 14:47:00.000000000 +0200
@@ -147,11 +147,31 @@
......@@ -30,7 +34,7 @@
- static const char unix_base[] = "/tmp/.X11-unix/X";
- const char *base = unix_base;
+ char *base;
+ base = _xcb_getandappendcompatibleenv("TMPDIR", "/tmp", "/.X11-unix/X");
+ base = _xcb_getandappendcompatibleenv("XORG_LOCK_DIR", "/tmp", "/.X11-unix/X");
size_t filelen;
char *file = NULL;
int actual_filelen;
Store Xorg lock files and sockets in different directories
This patch allow easy enable isolation of multiple Xorg servers and clients
running on same machine, instead of using the convention to store sockets and
lock files in /tmp/ store them in a directory defined in XORG_LOCK_DIR
environment variable.
When this environment variable is not set, fallbacks to the traditional
behavior of using /tmp/ .
--- xorg-server-1.9.3/os/utils.c.old 2012-03-29 18:20:02.000000000 +0200
+++ xorg-server-1.9.3/os/utils.c 2012-03-29 18:39:33.000000000 +0200
@@ -226,7 +226,26 @@ OsSignal(int sig, OsSigHandlerPtr handle
......@@ -24,7 +33,7 @@
+
+}
+
+#define LOCK_DIR getcompatibleenv("TMPDIR", "/tmp")
+#define LOCK_DIR getcompatibleenv("XORG_LOCK_DIR", "/tmp")
#define LOCK_TMP_PREFIX "/.tX"
#define LOCK_PREFIX "/.X"
#define LOCK_SUFFIX "-lock"
Store Xorg lock files and sockets in different directories
see xorg-server_tmp_env.patch
--- xtrans-1.2.6/Xtranssock.c.old 2012-03-29 14:25:45.000000000 +0200
+++ xtrans-1.2.6/Xtranssock.c 2012-03-29 18:40:54.000000000 +0200
@@ -207,29 +207,49 @@ static int TRANS(SocketINETClose) (Xtran
......@@ -27,38 +31,38 @@
#if defined(X11_t)
-#define UNIX_PATH "/tmp/.X11-unix/X"
-#define UNIX_DIR "/tmp/.X11-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.X11-unix/X")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.X11-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.X11-unix/X")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.X11-unix")
#endif /* X11_t */
#if defined(XIM_t)
-#define UNIX_PATH "/tmp/.XIM-unix/XIM"
-#define UNIX_DIR "/tmp/.XIM-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.XIM-unix/XIM")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.XIM-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.XIM-unix/XIM")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.XIM-unix")
#endif /* XIM_t */
#if defined(FS_t) || defined(FONT_t)
-#define UNIX_PATH "/tmp/.font-unix/fs"
-#define UNIX_DIR "/tmp/.font-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.font-unix/fs")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.font-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.font-unix/fs")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.font-unix")
#endif /* FS_t || FONT_t */
#if defined(ICE_t)
-#define UNIX_PATH "/tmp/.ICE-unix/"
-#define UNIX_DIR "/tmp/.ICE-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.ICE-unix/")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.ICE-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.ICE-unix/")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.ICE-unix")
#endif /* ICE_t */
#if defined(TEST_t)
-#define UNIX_PATH "/tmp/.Test-unix/test"
-#define UNIX_DIR "/tmp/.Test-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.Test-unix/test")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.Test-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.Test-unix/test")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.Test-unix")
#endif
#if defined(LBXPROXY_t)
-#define UNIX_PATH "/tmp/.X11-unix/X"
-#define UNIX_DIR "/tmp/.X11-unix"
+#define UNIX_PATH getandappendcompatibleenv(0, "TMPDIR", "/tmp", "/.X11-unix/X")
+#define UNIX_DIR getandappendcompatibleenv(1, "TMPDIR", "/tmp", "/.X11-unix")
+#define UNIX_PATH getandappendcompatibleenv(0, "XORG_LOCK_DIR", "/tmp", "/.X11-unix/X")
+#define UNIX_DIR getandappendcompatibleenv(1, "XORG_LOCK_DIR", "/tmp", "/.X11-unix")
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment