From eb23acaf59ec214d5deeff109e293004b2c29f29c7709de5ed72a3bdd7075fdc Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sat, 24 Mar 2018 13:06:13 +0000 Subject: [PATCH] Accepting request 590607 from GNOME:Next - Retire gdm-xwayland-xauth.patch (bsc#1084737): We now do this in the compositor instead. OBS-URL: https://build.opensuse.org/request/show/590607 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=390 --- gdm-xwayland-xauth.patch | 161 --------------------------------------- gdm.changes | 6 ++ gdm.spec | 3 - 3 files changed, 6 insertions(+), 164 deletions(-) delete mode 100644 gdm-xwayland-xauth.patch diff --git a/gdm-xwayland-xauth.patch b/gdm-xwayland-xauth.patch deleted file mode 100644 index 556e922..0000000 --- a/gdm-xwayland-xauth.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index 5e9eb5e..80cce87 100644 ---- a/daemon/Makefile.am -+++ b/daemon/Makefile.am -@@ -147,11 +147,13 @@ nodist_gdm_session_worker_SOURCES = \ - gdm-session-enum-types.h \ - $(NULL) - -+## We need XLIB_LIBS for Xauth. - gdm_wayland_session_LDADD = \ - $(top_builddir)/common/libgdmcommon.la \ - $(GTK_LIBS) \ - $(COMMON_LIBS) \ - $(SYSTEMD_LIBS) \ -+ $(XLIB_LIBS) \ - $(NULL) - - gdm_wayland_session_SOURCES = \ -diff --git a/daemon/gdm-wayland-session.c b/daemon/gdm-wayland-session.c -index b648e9d..bfadf9b 100644 ---- a/daemon/gdm-wayland-session.c -+++ b/daemon/gdm-wayland-session.c -@@ -36,6 +36,8 @@ - - #include - -+#include -+ - #define BUS_ADDRESS_FILENO (STDERR_FILENO + 1) - - typedef struct -@@ -47,6 +49,8 @@ typedef struct - GDBusConnection *bus_connection; - char *bus_address; - -+ char *x_auth_file; -+ - char **environment; - - GSubprocess *session_subprocess; -@@ -58,6 +62,102 @@ typedef struct - guint32 debug_enabled : 1; - } State; - -+static FILE * -+create_auth_file (char **filename) -+{ -+ char *auth_dir = NULL; -+ char *auth_file = NULL; -+ int fd; -+ FILE *fp = NULL; -+ -+ auth_dir = g_build_filename (g_get_user_runtime_dir (), -+ "gdm", -+ NULL); -+ -+ g_mkdir_with_parents (auth_dir, 0711); -+ auth_file = g_build_filename (auth_dir, "Xauthority", NULL); -+ g_clear_pointer (&auth_dir, g_free); -+ -+ fd = g_open (auth_file, O_RDWR | O_CREAT | O_TRUNC, 0700); -+ -+ if (fd < 0) { -+ g_debug ("could not open %s to store auth cookie: %m", -+ auth_file); -+ g_clear_pointer (&auth_file, g_free); -+ goto out; -+ } -+ -+ fp = fdopen (fd, "w+"); -+ -+ if (fp == NULL) { -+ g_debug ("could not set up stream for auth cookie file: %m"); -+ g_clear_pointer (&auth_file, g_free); -+ close (fd); -+ goto out; -+ } -+ -+ *filename = auth_file; -+out: -+ return fp; -+} -+ -+static char * -+prepare_auth_file (void) -+{ -+ FILE *fp = NULL; -+ char *filename = NULL; -+ GError *error = NULL; -+ gboolean prepared = FALSE; -+ Xauth auth_entry = { 0 }; -+ char localhost[HOST_NAME_MAX + 1] = ""; -+ -+ g_debug ("Preparing auth file for X server"); -+ -+ fp = create_auth_file (&filename); -+ -+ if (fp == NULL) { -+ return NULL; -+ } -+ -+ if (gethostname (localhost, HOST_NAME_MAX) < 0) { -+ strncpy (localhost, "localhost", sizeof (localhost) - 1); -+ } -+ -+ auth_entry.family = FamilyLocal; -+ auth_entry.address = localhost; -+ auth_entry.address_length = strlen (auth_entry.address); -+ auth_entry.name = "MIT-MAGIC-COOKIE-1"; -+ auth_entry.name_length = strlen (auth_entry.name); -+ -+ auth_entry.data_length = 16; -+ auth_entry.data = gdm_generate_random_bytes (auth_entry.data_length, &error); -+ -+ if (error != NULL) { -+ goto out; -+ } -+ -+ if (!XauWriteAuth (fp, &auth_entry) || fflush (fp) == EOF) { -+ goto out; -+ } -+ -+ auth_entry.family = FamilyWild; -+ if (!XauWriteAuth (fp, &auth_entry) || fflush (fp) == EOF) { -+ goto out; -+ } -+ -+ prepared = TRUE; -+ -+out: -+ g_clear_pointer (&auth_entry.data, g_free); -+ g_clear_pointer (&fp, fclose); -+ -+ if (!prepared) { -+ g_clear_pointer (&filename, g_free); -+ } -+ -+ return filename; -+} -+ - static void - on_bus_finished (GSubprocess *subprocess, - GAsyncResult *result, -@@ -333,6 +433,8 @@ spawn_session (State *state, - g_subprocess_launcher_setenv (launcher, "DBUS_SESSION_BUS_ADDRESS", state->bus_address, TRUE); - } - -+ g_subprocess_launcher_setenv (launcher, "XAUTHORITY", state->x_auth_file, TRUE); -+ - subprocess = g_subprocess_launcher_spawnv (launcher, - (const char * const *) argv, - &error); -@@ -510,6 +612,8 @@ main (int argc, - - g_unix_signal_add (SIGTERM, (GSourceFunc) on_sigterm, state); - -+ state->x_auth_file = prepare_auth_file (); -+ - ret = spawn_bus (state, state->cancellable); - - if (!ret) { diff --git a/gdm.changes b/gdm.changes index fe5f063..914a2e4 100644 --- a/gdm.changes +++ b/gdm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 22 20:20:46 CET 2018 - hpj@suse.com + +- Retire gdm-xwayland-xauth.patch (bsc#1084737): We now do this + in the compositor instead. + ------------------------------------------------------------------- Tue Mar 20 17:34:03 UTC 2018 - dimstar@opensuse.org diff --git a/gdm.spec b/gdm.spec index 1f87e65..b50ca36 100644 --- a/gdm.spec +++ b/gdm.spec @@ -59,8 +59,6 @@ Patch41: gdm-plymouth-vt1.patch Patch42: gdm-fails-to-restart-gnome-shell.patch # PATCH-FIX-UPSTREAM gdm-add-runtime-option-to-disable-starting-X-server-as-u.patch bnc#1075805 bgo#793255 msrb@suse.com -- Add runtime option to start X under root instead of regular user. Necessary if no DRI drivers are present. Patch43: gdm-add-runtime-option-to-disable-starting-X-server-as-u.patch -# PATCH-FIX-OPENSUSE gdm-xwayland-xauth.patch hpj@suse.com bsc#1084737 -- Create Xauthority file and export XAUTHORITY for Xwayland -Patch44: gdm-xwayland-xauth.patch ### NOTE: Keep please SLE-only patches at bottom (starting on 1000). # PATCH-FIX-SLE gdm-disable-gnome-initial-setup.patch bnc#1067976 qzhao@suse.com -- Disable gnome-initial-setup runs before gdm, g-i-s will only serve for CJK people to choose the input-method after login. Patch1002: gdm-disable-gnome-initial-setup.patch @@ -204,7 +202,6 @@ cp %{SOURCE8} . %patch41 -p1 %patch42 -p1 %patch43 -p1 -%patch44 -p1 # SLE-only patches start at 1000 %if !0%{?is_opensuse} %patch1002 -p1