Package: mate-session-manager Version: 1.8.1-6 Severity: normal Tags: patch
Dear Maintainer, The patch introduced by #775189 to allow users to disable gnome-keyring integration has a logic issue and leads to only *one* of the components to be initialized (in order, `smproxy`, then `keyring`). This means that with the default list of `['keyring', 'smproxy']`, only the `smproxy` component will get initialized. In practice it breaks the keyring, including gpg-agent and ssh-agent. Attached is a patch that simplifies the code and makes its logic correct: test *each* entry in the list and act accordingly. Note: this patch may not be perfect as if there are duplicated entries in the list the relevant component will be initialized twice, but this didn't seem too dangerous. If this is a real concern, it can easily be fixed by adding a flag for each component and check it before initializing it (and set if after, of course). Regards, Colomban PS: the patch is a manual diff between two copies from `apt-get sources` -- and thus is a patch against the previously patched state. I would gladly make a proper patch against the upstream source using Git, but I couldn't figure out how this works with Debian stuff like gbp. If there is a quick and simple guide or alike, or if a patch against direct upstream (where?) Git is ok, I can re-do it. -- System Information: Debian Release: 8.0 APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages mate-session-manager depends on: ii dbus-x11 1.8.14-1 ii dconf-gsettings-backend [gsettings-backend] 0.22.0-1 ii libc6 2.19-13 ii libdbus-1-3 1.8.14-1 ii libdbus-glib-1-2 0.102-1 ii libgdk-pixbuf2.0-0 2.31.1-2+b1 ii libglib2.0-0 2.42.1-1 ii libgtk2.0-0 2.24.25-1 ii libice6 2:1.0.9-1+b1 ii libsm6 2:1.2.2-1+b1 ii libsystemd0 215-9 ii libx11-6 2:1.6.2-3 ii libxau6 1:1.0.8-1 ii libxext6 2:1.3.3-1 ii libxrender1 1:0.9.8-1+b1 ii libxtst6 2:1.2.2-1+b1 ii upower 0.99.1-3.1 Versions of packages mate-session-manager recommends: ii caja 1.8.2-1 ii marco 1.8.2+dfsg1-4 ii mate-panel 1.8.1+dfsg1-3 ii mate-polkit 1.8.0+dfsg1-4 ii mate-settings-daemon 1.8.2-1 mate-session-manager suggests no packages. -- no debconf information
--- mate-session-manager-1.8.1/mate-session/msm-gnome.c 2015-01-17 15:08:00.000000000 +0100 +++ mate-session-manager-1.8.1.new/mate-session/msm-gnome.c 2015-01-17 14:48:37.553305616 +0100 @@ -237,8 +237,6 @@ { GSettings* settings; gchar **array; - GList *startup = NULL; - gint i; if (gnome_compat_started == TRUE) return; @@ -246,32 +244,26 @@ settings = g_settings_new (GSM_SCHEMA); array = g_settings_get_strv (settings, GSM_GNOME_COMPAT_STARTUP_KEY); if (array) { - for (i = 0; array[i]; i++) { - startup = g_list_append (startup, g_strdup (array[i])); - } - } - g_strfreev (array); - g_object_unref (settings); + guint i; - if (startup != NULL) { - if (g_list_find_custom (startup, "smproxy", (GCompareFunc) strcmp) != NULL) { - g_debug ("MsmGnome: starting smproxy"); - msm_compat_gnome_smproxy_startup (); - gnome_compat_started = TRUE; - } else if (g_list_find_custom (startup, "keyring", (GCompareFunc) strcmp) != NULL) { - g_debug ("MsmGnome: starting keyring"); - gnome_keyring_daemon_startup (); - gnome_compat_started = TRUE; - } else { - g_debug ("MsmGnome: unknown component, ignoring"); + for (i = 0; array[i]; i++) { + if (strcmp (array[i], "smproxy") == 0) { + g_debug ("MsmGnome: starting smproxy"); + msm_compat_gnome_smproxy_startup (); + gnome_compat_started = TRUE; + } else if (strcmp (array[i], "keyring") == 0) { + g_debug ("MsmGnome: starting keyring"); + gnome_keyring_daemon_startup (); + gnome_compat_started = TRUE; + } else { + g_debug ("MsmGnome: ignoring unknown component \"%s\"", array[i]); + } } - - g_list_foreach (startup, (GFunc) g_free, NULL); - g_list_free (startup); - + g_strfreev (array); } else { g_debug ("MsmGnome: No components found to start"); } + g_object_unref (settings); }