rpms/gnome-keyring/devel gnome-keyring-2.20-no_match.patch, NONE, 1.1 gnome-keyring.spec, 1.57, 1.58

Alexander Larsson (alexl) fedora-extras-commits at redhat.com
Thu Oct 4 06:48:46 UTC 2007


Author: alexl

Update of /cvs/pkgs/rpms/gnome-keyring/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13824

Modified Files:
	gnome-keyring.spec 
Added Files:
	gnome-keyring-2.20-no_match.patch 
Log Message:
* Thu Oct  4 2007 Alexander Larsson <alexl at redhat.com> - 2.20-3
- Add NO_MATCH error patch from svn. Will fix apps that
  can't handle empty list matches


gnome-keyring-2.20-no_match.patch:

--- NEW FILE gnome-keyring-2.20-no_match.patch ---
Index: tests/unit-test-keyrings.c
===================================================================
--- tests/unit-test-keyrings.c	(revision 842)
+++ tests/unit-test-keyrings.c	(revision 843)
@@ -249,8 +249,8 @@
 }
 
 /* 
- * A find that does not match should return zero results, not some error message:
- * http://bugzilla.gnome.org/show_bug.cgi?id=447315
+ * A find that does not match should return 'Not Found':
+ * http://bugzilla.gnome.org/show_bug.cgi?id=476682
  */
 void unit_test_find_invalid (CuTest* cu)
 {
@@ -263,8 +263,7 @@
 	
 	/* Now try to find it */
 	res = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET, attrs, &found);
-	CuAssertIntEquals(cu, GNOME_KEYRING_RESULT_OK, res);
-	CuAssert(cu, "Shouldn't have matched any items", g_list_length (found) == 0);
+	CuAssertIntEquals(cu, GNOME_KEYRING_RESULT_NO_MATCH, res);
 }
 
 void unit_test_lock_keyrings (CuTest* cu)
Index: daemon/gkr-daemon-ops.c
===================================================================
--- daemon/gkr-daemon-ops.c	(revision 842)
+++ daemon/gkr-daemon-ops.c	(revision 843)
@@ -1784,8 +1784,12 @@
 	if (ctx.nfound > 0 && ctx.items == NULL)
 		gkr_buffer_add_uint32 (result, GNOME_KEYRING_RESULT_DENIED);
 		
-	/* Zero or more items matched and given access to */
-	else
+	/* Zero items matched  */
+	else if (ctx.nfound == 0)
+		gkr_buffer_add_uint32 (result, GNOME_KEYRING_RESULT_NO_MATCH);
+
+	/* More than one item found and given access to */
+	else	
 		gkr_buffer_add_uint32 (result, GNOME_KEYRING_RESULT_OK);
 
 	ctx.items = g_list_sort_with_data (ctx.items, sort_found, ctx.attributes);
Index: library/gnome-keyring-utils.c
===================================================================
--- library/gnome-keyring-utils.c	(revision 842)
+++ library/gnome-keyring-utils.c	(revision 843)
@@ -111,14 +111,25 @@
 		return _("Access Denied");
 	case GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON:
 		return _("The gnome-keyring-daemon application is not running.");
-	case GNOME_KEYRING_RESULT_NO_SUCH_KEYRING:
-		return _("The keyring has already been unlocked.");
 	case GNOME_KEYRING_RESULT_IO_ERROR:
 		return _("Error communicating with gnome-keyring-daemon");
 	case GNOME_KEYRING_RESULT_ALREADY_EXISTS:
 		return _("A keyring with that name already exists");	
 	case GNOME_KEYRING_RESULT_BAD_ARGUMENTS:
 		return _("Programmer error: The application sent invalid data.");
+		
+	/* 
+	 * TODO: These needs to be better messages, and translated in next 
+	 * release. This was added late because poorly written programs 
+	 * were assuming incorrect things about our result codes, and ABI
+	 * compatibility and all that. 
+	 * 
+	 * http://bugzilla.gnome.org/show_bug.cgi?id=476682
+	 */
+	case GNOME_KEYRING_RESULT_NO_MATCH:
+		return "No Results"; 
+	case GNOME_KEYRING_RESULT_NO_SUCH_KEYRING:
+		return "No such keyring exists";
 	
 	/* 
 	 * This would be a dumb message to display to the user, we never return 
Index: library/gnome-keyring-result.h
===================================================================
--- library/gnome-keyring-result.h	(revision 842)
+++ library/gnome-keyring-result.h	(revision 843)
@@ -33,7 +33,8 @@
 	GNOME_KEYRING_RESULT_BAD_ARGUMENTS,
 	GNOME_KEYRING_RESULT_IO_ERROR,
 	GNOME_KEYRING_RESULT_CANCELLED,
-	GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS
+	GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS,
+	GNOME_KEYRING_RESULT_NO_MATCH
 } GnomeKeyringResult;
 
 #define GNOME_KEYRING_RESULT_ALREADY_EXISTS \


Index: gnome-keyring.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-keyring/devel/gnome-keyring.spec,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- gnome-keyring.spec	3 Oct 2007 14:04:37 -0000	1.57
+++ gnome-keyring.spec	4 Oct 2007 06:48:12 -0000	1.58
@@ -3,7 +3,7 @@
 Summary: A framework for managing user passwords and other secrets
 Name: gnome-keyring
 Version: 2.20
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gnome-keyring/2.20/gnome-keyring-%{version}.tar.bz2
@@ -22,6 +22,7 @@
 # Backport from svn
 Patch1:    gnome-keyring-2.20-add_new_keyrings.patch
 Patch2:    gnome-keyring-2.20-no-unset-default.patch
+Patch3:    gnome-keyring-2.20-no_match.patch
 
 %description
 gnome-keyring manages passwords and other types of secrets
@@ -63,6 +64,7 @@
 
 %patch1 -p0 -b .add_new_keyrings
 %patch2 -p1 -b .no_unset_default
+%patch3 -p0 -b .no_match
 
 %build
 aclocal
@@ -109,6 +111,10 @@
 
 
 %changelog
+* Thu Oct  4 2007 Alexander Larsson <alexl at redhat.com> - 2.20-3
+- Add NO_MATCH error patch from svn. Will fix apps that
+  can't handle empty list matches
+
 * Mon Oct 3 2007 Alexander Larsson <alexl at redhat.com> - 2.20-2
 - Backport fix from svn where newly created keyrings weren't
   found




More information about the fedora-extras-commits mailing list