From 204ddbbc33af16656356d1e19dfa1b80403242b4 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 09 2014 07:38:44 +0000 Subject: import gnome-keyring-3.8.2-8.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0dd59c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/gnome-keyring-3.8.2.tar.xz diff --git a/SOURCES/daemon-Exit-gnome-keyring-daemon-when-the-DBus-con.patch b/SOURCES/daemon-Exit-gnome-keyring-daemon-when-the-DBus-con.patch deleted file mode 100644 index bc74533..0000000 --- a/SOURCES/daemon-Exit-gnome-keyring-daemon-when-the-DBus-con.patch +++ /dev/null @@ -1,286 +0,0 @@ -From 992b1e1dcbf9402f8064990a064f1b5928a2cfe8 Mon Sep 17 00:00:00 2001 -From: Stef Walter -Date: Thu, 6 Mar 2014 16:11:12 +0100 -Subject: [PATCH] daemon: Exit gnome-keyring-daemon when the DBus connection - closes - -We don't do this via the standard mechanism, as it means that libdbus -just calls _exit() (not even exit()) when the connection goes away. - -This can lead to inconsistent state. Shutdown should be orderly. - -https://bugzilla.gnome.org/show_bug.cgi?id=708765 - -Conflicts: - daemon/Makefile.am - daemon/dbus/gkd-dbus.c ---- - daemon/dbus/gkd-dbus.c | 11 ++++- - daemon/gkd-main.c | 4 +- - daemon/test-shutdown.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ - egg/egg-dbus.c | 21 +++++++-- - egg/egg-dbus.h | 4 +- - 5 files changed, 147 insertions(+), 8 deletions(-) - create mode 100644 daemon/test-shutdown.c - -diff --git a/daemon/dbus/gkd-dbus.c b/daemon/dbus/gkd-dbus.c -index 92daafb..36cacfa 100644 ---- a/daemon/dbus/gkd-dbus.c -+++ b/daemon/dbus/gkd-dbus.c -@@ -27,6 +27,8 @@ - #include "gkd-dbus-private.h" - - #include "gkd-util.h" -+#include "daemon/gkd-main.h" -+#include "daemon/gkd-util.h" - - #include "egg/egg-cleanup.h" - #include "egg/egg-dbus.h" -@@ -55,6 +57,13 @@ cleanup_session_bus (gpointer unused) - dbus_conn = NULL; - } - -+static void -+on_connection_close (gpointer user_data) -+{ -+ g_debug ("dbus connection closed, exiting"); -+ gkd_main_quit (); -+} -+ - static gboolean - connect_to_session_bus (void) - { -@@ -73,7 +82,7 @@ connect_to_session_bus (void) - return FALSE; - } - -- egg_dbus_connect_with_mainloop (dbus_conn, NULL); -+ egg_dbus_connect_with_mainloop (dbus_conn, NULL, on_connection_close); - dbus_connection_set_exit_on_disconnect (dbus_conn, FALSE); - egg_cleanup_register (cleanup_session_bus, NULL); - return TRUE; -diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c -index 1d10132..df0ef91 100644 ---- a/daemon/gkd-main.c -+++ b/daemon/gkd-main.c -@@ -81,6 +81,8 @@ typedef int socklen_t; - - EGG_SECURE_DECLARE (daemon_main); - -+static GMainLoop *loop = NULL; -+ - /* ----------------------------------------------------------------------------- - * COMMAND LINE - */ -@@ -878,8 +880,6 @@ on_idle_initialize (gpointer data) - int - main (int argc, char *argv[]) - { -- GMainLoop *loop; -- - /* - * The gnome-keyring startup is not as simple as I wish it could be. - * -diff --git a/daemon/test-shutdown.c b/daemon/test-shutdown.c -new file mode 100644 -index 0000000..b2fdb0c ---- /dev/null -+++ b/daemon/test-shutdown.c -@@ -0,0 +1,115 @@ -+/* -+ Copyright (C) 2014 Red Hat Inc -+ -+ The Gnome Keyring Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Library General Public License as -+ published by the Free Software Foundation; either version 2 of the -+ License, or (at your option) any later version. -+ -+ The Gnome Keyring Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Library General Public License for more details. -+ -+ You should have received a copy of the GNU Library General Public -+ License along with the Gnome Library; see the file COPYING.LIB. If not, -+ . -+ -+ Author: Stef Walter -+*/ -+ -+#include "config.h" -+ -+#include "gkd-test.h" -+ -+#include "daemon/control/gkd-control.h" -+ -+#include "egg/egg-testing.h" -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+typedef struct { -+ GTestDBus *dbus; -+ gchar *directory; -+ GPid pid; -+} Test; -+ -+static void -+setup (Test *test, -+ gconstpointer unused) -+{ -+ test->dbus = g_test_dbus_new (G_TEST_DBUS_NONE); -+ g_test_dbus_up (test->dbus); -+ -+ test->directory = egg_tests_create_scratch_directory (NULL, NULL); -+} -+ -+static void -+teardown (Test *test, -+ gconstpointer unused) -+{ -+ if (test->pid) { -+ if (waitpid (test->pid, NULL, WNOHANG) != test->pid) { -+ kill (test->pid, SIGTERM); -+ g_assert_cmpint (waitpid (test->pid, NULL, 0), ==, test->pid); -+ } -+ g_spawn_close_pid (test->pid); -+ } -+ -+ egg_tests_remove_scratch_directory (test->directory); -+ g_free (test->directory); -+ -+ if (test->dbus) { -+ g_test_dbus_down (test->dbus); -+ g_object_unref (test->dbus); -+ } -+} -+ -+static void -+test_close_connection (Test *test, -+ gconstpointer unused) -+{ -+ const gchar *argv[] = { -+ BUILDDIR "/gnome-keyring-daemon", "--foreground", -+ "--components=secrets,pkcs11", NULL -+ }; -+ -+ const gchar *control; -+ gchar **output; -+ gint status; -+ GPid pid; -+ -+ output = gkd_test_launch_daemon (test->directory, argv, &pid, NULL); -+ -+ control = g_environ_getenv (output, "GNOME_KEYRING_CONTROL"); -+ g_assert_cmpstr (control, !=, NULL); -+ -+ g_assert (gkd_control_unlock (control, "booo")); -+ g_strfreev (output); -+ -+ /* Now close the dbus connection */ -+ g_test_dbus_down (test->dbus); -+ g_object_unref (test->dbus); -+ test->dbus = NULL; -+ -+ /* Daemon should exit */ -+ g_assert_cmpint (waitpid (pid, &status, 0), ==, pid); -+ g_assert_cmpint (status, ==, 0); -+} -+ -+int -+main (int argc, char **argv) -+{ -+ g_test_init (&argc, &argv, NULL); -+ -+ g_test_add ("/daemon/shutdown/dbus-connection", Test, NULL, -+ setup, test_close_connection, teardown); -+ -+ return g_test_run (); -+} -diff --git a/egg/egg-dbus.c b/egg/egg-dbus.c -index 353f6ce..f6323b8 100644 ---- a/egg/egg-dbus.c -+++ b/egg/egg-dbus.c -@@ -38,13 +38,21 @@ - typedef struct { - GSource source; /* the parent GSource */ - DBusConnection *connection; /* the connection to dispatch */ -+ GDestroyNotify closed_cb; /* Callback when closed */ - } DBusGMessageQueue; - - static gboolean - message_queue_prepare (GSource *source, gint *timeout) - { -- DBusConnection *connection = ((DBusGMessageQueue *)source)->connection; -+ DBusGMessageQueue *queue = ((DBusGMessageQueue *)source); -+ DBusConnection *connection = queue->connection; - *timeout = -1; -+ if (queue->closed_cb) { -+ if (!dbus_connection_get_is_connected (connection)) { -+ (queue->closed_cb) (connection); -+ queue->closed_cb = NULL; -+ } -+ } - return (dbus_connection_get_dispatch_status (connection) == DBUS_DISPATCH_DATA_REMAINS); - } - -@@ -96,7 +104,9 @@ typedef struct { - } TimeoutHandler; - - static ConnectionSetup* --connection_setup_new (GMainContext *context, DBusConnection *connection) -+connection_setup_new (GMainContext *context, -+ DBusConnection *connection, -+ GDestroyNotify closed_cb) - { - ConnectionSetup *cs = g_new0 (ConnectionSetup, 1); - g_assert (context != NULL); -@@ -109,6 +119,7 @@ connection_setup_new (GMainContext *context, DBusConnection *connection) - cs->message_queue_source = g_source_new ((GSourceFuncs *) &message_queue_funcs, - sizeof (DBusGMessageQueue)); - ((DBusGMessageQueue*)cs->message_queue_source)->connection = connection; -+ ((DBusGMessageQueue*)cs->message_queue_source)->closed_cb = closed_cb; - g_source_attach (cs->message_queue_source, cs->context); - } - -@@ -369,13 +380,15 @@ wakeup_main (void *data) - } - - void --egg_dbus_connect_with_mainloop (DBusConnection *connection, GMainContext *context) -+egg_dbus_connect_with_mainloop (DBusConnection *connection, -+ GMainContext *context, -+ GDestroyNotify close_callback) - { - ConnectionSetup *cs; - - if (context == NULL) - context = g_main_context_default (); -- cs = connection_setup_new (context, connection); -+ cs = connection_setup_new (context, connection, close_callback); - the_setup = cs; - - if (!dbus_connection_set_watch_functions (connection, add_watch, -diff --git a/egg/egg-dbus.h b/egg/egg-dbus.h -index ed87e20..4d328ca 100644 ---- a/egg/egg-dbus.h -+++ b/egg/egg-dbus.h -@@ -28,7 +28,9 @@ - #include - #include - --void egg_dbus_connect_with_mainloop (DBusConnection *connection, GMainContext *context); -+void egg_dbus_connect_with_mainloop (DBusConnection *connection, -+ GMainContext *context, -+ GDestroyNotify close_callback); - - void egg_dbus_disconnect_from_mainloop (DBusConnection *connection, GMainContext *context); - --- -1.8.5.3 - diff --git a/SPECS/gnome-keyring.spec b/SPECS/gnome-keyring.spec index 5dc27cc..5e8feb2 100644 --- a/SPECS/gnome-keyring.spec +++ b/SPECS/gnome-keyring.spec @@ -7,7 +7,7 @@ Summary: Framework for managing passwords and other secrets Name: gnome-keyring Version: 3.8.2 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Libraries #VCS: git:git://git.gnome.org/gnome-keyring @@ -18,8 +18,7 @@ Patch0: 0002-daemon-Add-gnome-keyring-daemon-manual-page.patch Patch1: 0001-Some-man-page-updates-for-gnome-keyring-daemon.patch Patch2: 0002-Add-a-man-page-for-the-gnome-keyring-tool.patch Patch3: 0003-Add-an-alias-man-page-for-gnome-keyring-3.patch -Patch4: daemon-Exit-gnome-keyring-daemon-when-the-DBus-con.patch -Patch5: 0001-pam-Fix-issue-with-changed-password-not-unlocking-ke.patch +Patch4: 0001-pam-Fix-issue-with-changed-password-not-unlocking-ke.patch BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gcr-devel >= %{gcr_version} @@ -68,7 +67,6 @@ automatically unlock the "login" keyring when the user logs in. %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 autoreconf -i -f @@ -131,6 +129,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %changelog +* Wed Apr 23 2014 Zeeshan Ali - 3.8.2-8 +- Remove patch 'daemon: Exit gnome-keyring-daemon when the DBus connection + closes' (related: rhbz#1030671). + * Tue Mar 18 2014 Zeeshan Ali - 3.8.2-7 - Fix issue with changed password not unlocking keyring (related: rhbz#1075715).