diff --git a/libgnome-keyring-2.29.5-assertion-password-not-found.patch b/libgnome-keyring-2.29.5-assertion-password-not-found.patch new file mode 100644 index 0000000..3bf3b3c --- /dev/null +++ b/libgnome-keyring-2.29.5-assertion-password-not-found.patch @@ -0,0 +1,90 @@ +From cf04a806f7cbd12bfb664a481b7a551650cb85b2 Mon Sep 17 00:00:00 2001 +From: Stef Walter +Date: Sun, 14 Feb 2010 04:23:58 +0000 +Subject: No assertion when password is not found. + +Would crash when gnome_keyring_find_password_xx() was called and +no password was found. + +Fixes bug #608709 +--- +diff --git a/library/gnome-keyring.c b/library/gnome-keyring.c +index c867787..8931fe5 100644 +--- a/library/gnome-keyring.c ++++ b/library/gnome-keyring.c +@@ -4374,10 +4374,19 @@ find_password_2_reply (GkrOperation *op, GkrSession *session, gpointer user_data + static void + find_password_1_reply (GkrOperation *op, const char *path, gpointer user_data) + { ++ GkrCallback *cb; ++ ++ /* All done, complete the operation here */ ++ if (path == NULL) { ++ cb = gkr_operation_pop (op); ++ gkr_callback_invoke_ok_string (cb, NULL); ++ + /* We need a session to get the secret for this item */ +- gkr_operation_push (op, find_password_2_reply, GKR_CALLBACK_OP_SESSION, +- g_strdup (path), g_free); +- gkr_session_negotiate (op); ++ } else { ++ gkr_operation_push (op, find_password_2_reply, GKR_CALLBACK_OP_SESSION, ++ g_strdup (path), g_free); ++ gkr_session_negotiate (op); ++ } + } + + static GkrOperation* +diff --git a/library/tests/test-keyrings.c b/library/tests/test-keyrings.c +index 7f7f1fa..aeba0ff 100644 +--- a/library/tests/test-keyrings.c ++++ b/library/tests/test-keyrings.c +@@ -480,6 +480,46 @@ DEFINE_TEST(find_password) + g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, find_password_result); + } + ++static GnomeKeyringResult find_no_password_result; ++ ++static void ++done_find_no_password (GnomeKeyringResult res, const gchar* password, gpointer unused) ++{ ++ find_no_password_result = res; ++ if(res == GNOME_KEYRING_RESULT_OK) ++ g_assert (password == NULL); ++ test_mainloop_quit (); ++} ++ ++DEFINE_TEST(find_no_password) ++{ ++ GnomeKeyringResult res; ++ gchar *password; ++ gpointer op; ++ ++ /* Synchronous, valid*/ ++ res = gnome_keyring_find_password_sync (&our_schema, &password, ++ "dog", "grunt", ++ "legs", 1000, ++ NULL); ++ g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, res); ++ g_assert (password == NULL); ++ ++ /* Asynchronous, less arguments */ ++ find_no_password_result = GNOME_KEYRING_RESULT_CANCELLED; ++ op = gnome_keyring_find_password (&our_schema, ++ done_find_no_password, NULL, NULL, ++ "dog", "grunt", ++ "legs", 1000, ++ NULL); ++ g_assert (op != NULL); ++ g_assert (find_no_password_result == GNOME_KEYRING_RESULT_CANCELLED); ++ ++ test_mainloop_run (2000); ++ ++ g_assert_cmpint (GNOME_KEYRING_RESULT_OK, ==, find_no_password_result); ++} ++ + static void + done_delete_password (GnomeKeyringResult res, gpointer data) + { +-- +cgit v0.8.3.1 diff --git a/libgnome-keyring.spec b/libgnome-keyring.spec index 2448268..36c1a0b 100644 --- a/libgnome-keyring.spec +++ b/libgnome-keyring.spec @@ -6,7 +6,7 @@ Summary: Framework for managing passwords and other secrets Name: libgnome-keyring Version: 2.29.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Libraries Source: http://ftp.gnome.org/pub/GNOME/sources/libgnome-keyring/2.29/libgnome-keyring-%{version}.tar.bz2 @@ -25,6 +25,7 @@ Conflicts: gnome-keyring < 2.29.4 Patch0: libgnome-keyring-2.29.5-acl-assertion.patch Patch1: libgnome-keyring-2.29.5-session-clear.patch Patch2: libgnome-keyring-2.29.5-set-info-type-property.patch +Patch3: libgnome-keyring-2.29.5-assertion-password-not-found.patch %description gnome-keyring is a program that keep password and other secrets for @@ -51,6 +52,7 @@ header files needed to develop applications that use libgnome-keyring. %patch0 -p1 -b .acl-assertion %patch1 -p1 -b .session-clear %patch2 -p1 -b .info-type +%patch3 -p1 -b .assert-not-found %build @@ -92,6 +94,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Feb 16 2010 Tomas Bzatek - 2.29.4-3 +- Fix assertion when password is not found + * Mon Jan 25 2010 Tomas Bzatek - 2.29.4-2 - Fix assertion calling deprecated acl function - Clear the client's session when the service disconnects