From ab32580b4c916914aec8429b3d4d68fef1dd583e Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Mon, 6 May 2024 18:32:28 -0400 Subject: [PATCH] Revert GNOME change to force X authentication See: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2633 It's a headache for us and it doesn't seem to be necessary because we don't share network namespace between citadel and (nspawn) realms. --- src/wayland/meta-xwayland.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index ea9c27d74..ef92b7dfc 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -741,6 +741,23 @@ prepare_auth_file (MetaXWaylandManager *manager, return TRUE; } +static void +add_local_user_to_xhost (Display *xdisplay) +{ + XHostAddress host_entry; + XServerInterpretedAddress siaddr; + + siaddr.type = (char *) "localuser"; + siaddr.typelength = strlen (siaddr.type); + siaddr.value = (char *) g_get_user_name(); + siaddr.valuelength = strlen (siaddr.value); + + host_entry.family = FamilyServerInterpreted; + host_entry.address = (char *) &siaddr; + + XAddHost (xdisplay, &host_entry); +} + static void on_init_x11_cb (MetaDisplay *display, GAsyncResult *result, @@ -1207,6 +1224,8 @@ meta_xwayland_setup_xdisplay (MetaXWaylandManager *manager, XSetIOErrorExitHandler (xdisplay, x_io_error_exit, manager); XFixesSetClientDisconnectMode (xdisplay, XFixesClientDisconnectFlagTerminate); + + add_local_user_to_xhost (xdisplay); } static void