r51962 - in /desktop/unstable/gdm3/debian: changelog gdm3.preinst patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch patches/series

smcv at users.alioth.debian.org smcv at users.alioth.debian.org
Sun Jan 29 01:59:23 UTC 2017


Author: smcv
Date: Sun Jan 29 01:59:22 2017
New Revision: 51962

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=51962
Log:
Work around upgrades not being done offline

- Add a non-upstreamable patch to edit D-Bus messages from libgdm
  to the session worker and adapt them from the pre-3.16 interface
  to the post-3.16 interface. Only do this if a flag file in /run
  has been created, so that this workaround will only be active
  until the next reboot.
- gdm3.preinst: Create that flag file on upgrades. (Closes: #789118)

Added:
    desktop/unstable/gdm3/debian/patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch
Modified:
    desktop/unstable/gdm3/debian/changelog
    desktop/unstable/gdm3/debian/gdm3.preinst
    desktop/unstable/gdm3/debian/patches/series

Modified: desktop/unstable/gdm3/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gdm3/debian/changelog?rev=51962&op=diff
==============================================================================
--- desktop/unstable/gdm3/debian/changelog	[utf-8] (original)
+++ desktop/unstable/gdm3/debian/changelog	[utf-8] Sun Jan 29 01:59:22 2017
@@ -7,6 +7,15 @@
   * debian/greeter.dconf-defaults:
     - Use the new emblem-debian-white.png for default login screen logo
       (Closes: #833529)
+
+  [ Simon McVittie ]
+  * Work around upgrades not being done offline:
+    - Add a non-upstreamable patch to edit D-Bus messages from libgdm
+      to the session worker and adapt them from the pre-3.16 interface
+      to the post-3.16 interface. Only do this if a flag file in /run
+      has been created, so that this workaround will only be active
+      until the next reboot.
+    - gdm3.preinst: Create that flag file on upgrades. (Closes: #789118)
 
  -- Michael Biebl <biebl at debian.org>  Mon, 17 Oct 2016 01:07:52 +0200
 

Modified: desktop/unstable/gdm3/debian/gdm3.preinst
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gdm3/debian/gdm3.preinst?rev=51962&op=diff
==============================================================================
--- desktop/unstable/gdm3/debian/gdm3.preinst	[utf-8] (original)
+++ desktop/unstable/gdm3/debian/gdm3.preinst	[utf-8] Sun Jan 29 01:59:22 2017
@@ -9,4 +9,9 @@
     fi
 fi
 
+if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.22; then
+    echo "Enabling compatibility workaround for upgrades from Debian 8..."
+    touch "/run/gdm3-upgraded-from-debian-8"
+fi
+
 #DEBHELPER#

Added: desktop/unstable/gdm3/debian/patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gdm3/debian/patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch?rev=51962&op=file
==============================================================================
--- desktop/unstable/gdm3/debian/patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch	(added)
+++ desktop/unstable/gdm3/debian/patches/Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch	[utf-8] Sun Jan 29 01:59:22 2017
@@ -0,0 +1,118 @@
+From 27365c4863a3a5127541ed9ac77cb29500466ab8 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv at debian.org>
+Date: Wed, 25 Jan 2017 10:58:28 +0000
+Subject: [PATCH] Hack D-Bus messages from Debian 8 libgdm to work with this
+ version
+
+There is one extra argument. Add that argument, setting it to FALSE,
+which makes this gdm behave like the only code path in Debian 8.
+
+Please remove this patch after Debian 9 is released.
+
+Forwarded: no, Debian-specific
+---
+ daemon/gdm-session-worker.c | 81 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 81 insertions(+)
+
+diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
+index 421ef028..6b14f003 100644
+--- a/daemon/gdm-session-worker.c
++++ b/daemon/gdm-session-worker.c
+@@ -3077,6 +3077,80 @@ gdm_session_worker_handle_start_reauthentication (GdmDBusWorker         *object,
+         return TRUE;
+ }
+ 
++/* A horrible hack to cope with reauthentication requests coming from
++ * Debian 8's libgdm, which might still be resident in memory if a user
++ * was running gnome-shell and lets it lock during the upgrade. */
++static GDBusMessage *
++rewrite_messages (GDBusConnection *connection,
++                  GDBusMessage *message,
++                  gboolean incoming,
++                  gpointer nil)
++{
++        g_autoptr (GDBusMessage) ret = NULL;
++        GVariant *body;
++        const gchar *service_name, *user_name, *x11_display, *x11_authority;
++        const gchar *display_device, *display_seat, *hostname;
++        gboolean display_is_local;
++
++        if (!incoming ||
++            g_dbus_message_get_message_type (message) !=
++                    G_DBUS_MESSAGE_TYPE_METHOD_CALL ||
++            g_dbus_message_get_num_unix_fds (message) != 0 ||
++            g_strcmp0 (g_dbus_message_get_interface (message),
++                       "org.gnome.DisplayManager.Worker") != 0 ||
++            g_strcmp0 (g_dbus_message_get_member (message),
++                       "SetupForUser") != 0 ||
++            g_strcmp0 (g_dbus_message_get_signature (message),
++                       "ssss" "sssb") != 0)
++                return message;
++
++        g_warning ("Patching old SetupForUser message from Debian 8 libgdm");
++
++        ret = g_dbus_message_copy (message, NULL);
++
++        /* If we can't copy it for whatever reason, just give up */
++        if (ret == NULL)
++        {
++                g_warning ("Failed to patch old SetupForUser message");
++                return message;
++        }
++
++        body = g_dbus_message_get_body (message);
++
++        g_variant_get (body,
++                       "(" "&s&s&s&s" "&s&s&sb" ")",
++
++                       &service_name,
++                       &user_name,
++                       &x11_display,
++                       &x11_authority,
++
++                       &display_device,
++                       &display_seat,
++                       &hostname,
++                       &display_is_local);
++
++        /* The new API has one aditional boolean argument, display_is_initial.
++         * Set it to FALSE to make gdm behave like it did in Debian 8. */
++        g_dbus_message_set_body (ret,
++                                 g_variant_new ("(" "ssss" "sssb" "b" ")",
++
++                                                service_name,
++                                                user_name,
++                                                x11_display,
++                                                x11_authority,
++
++                                                display_device,
++                                                display_seat,
++                                                hostname,
++                                                display_is_local,
++
++                                                FALSE));
++
++        g_object_unref (message);
++        return g_steal_pointer (&ret);
++}
++
+ static GObject *
+ gdm_session_worker_constructor (GType                  type,
+                                 guint                  n_construct_properties,
+@@ -3104,6 +3178,13 @@ gdm_session_worker_constructor (GType                  type,
+                 exit (1);
+         }
+ 
++        if (worker->priv->is_reauth_session &&
++            g_file_test ("/run/gdm3-upgraded-from-debian-8",
++                         G_FILE_TEST_EXISTS)) {
++                g_dbus_connection_add_filter (worker->priv->connection,
++                                              rewrite_messages, NULL, NULL);
++        }
++
+         worker->priv->manager = GDM_DBUS_WORKER_MANAGER (gdm_dbus_worker_manager_proxy_new_sync (worker->priv->connection,
+                                                                                                  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+                                                                                                  NULL, /* dbus name */
+-- 
+2.11.0
+

Modified: desktop/unstable/gdm3/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gdm3/debian/patches/series?rev=51962&op=diff
==============================================================================
--- desktop/unstable/gdm3/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/gdm3/debian/patches/series	[utf-8] Sun Jan 29 01:59:22 2017
@@ -4,3 +4,4 @@
 91_dconf_database_path.patch
 92_systemd_unit.patch
 94_retain_xorg_log.patch
+Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch




More information about the pkg-gnome-commits mailing list