From 210fbd8c47b7af08b1471591866b6a9fe344d6b5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 31 Jul 2019 15:52:24 +0100
Subject: [PATCH] wrap: Don't set a custom hostname for the container

This was a nice idea as a quick way to see which was which, and it works
OK if your X display has uid-based access control via
`xhost +si:localuser:$(id -nu)` (like Debian derivatives and systems
that use gdm); but it breaks MIT magic cookie (XAUTHORITY) authentication
on systems that rely on that, like Plasma Desktop on Manjaro.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 src/wrap.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/src/wrap.c b/src/wrap.c
index c78ad71e2..115bacc65 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -1978,18 +1978,6 @@ main (int argc,
                           "--unsetenv", "PWD",
                           NULL);
 
-  if (strstr (bwrap_help, "unshare-uts") != NULL)
-    {
-      g_debug ("Setting hostname...");
-
-      /* Set a standard hostname for the container to make it easier
-       * to see which shell is which */
-      flatpak_bwrap_add_args (bwrap,
-                              "--unshare-uts",
-                              "--hostname", "pressure-vessel",
-                              NULL);
-    }
-
   /* TODO: Potential future expansion: use --unshare-pid for more isolation */
 
   /* Put Steam Runtime environment variables back, if /usr is mounted
-- 
GitLab