--- a/patches/gnome-keyring-01-pkcs.diff Fri Jul 21 12:32:22 2006 +0000
+++ b/patches/gnome-keyring-01-pkcs.diff Fri Jul 21 13:46:54 2006 +0000
@@ -17,43 +17,26 @@
}
+
+#endif /* ! HAVE_PKCS11 */
-diff -urNp gnome-keyring-0.4.5/configure.in gnome-keyring-0.4.5-hacked/configure.in
---- gnome-keyring-0.4.5/configure.in 2005-09-06 13:05:13.000000000 +1200
-+++ gnome-keyring-0.4.5-hacked/configure.in 2005-09-18 21:14:54.067769704 +1200
-@@ -101,7 +101,6 @@ AC_STAT_MACROS_BROKEN
- AC_CHECK_HEADERS(fcntl.h sys/time.h time.h unistd.h)
- AC_CHECK_FUNCS(gettimeofday)
-
--
- AC_CHECK_LIB(socket, socket)
-
- have_socket=no
-@@ -116,6 +115,25 @@ if test $have_socket = no; then
- break])
+--- gnome-keyring-0.5.1/configure.in 2006-06-12 12:07:39.000000000 +0100
++++ gnome-keyring-0.5.1-hacked/configure.in 2006-07-21 14:26:36.126696000 +0100
+@@ -125,6 +125,17 @@
done
fi
-+
-+# Check for getpeerucred
-+#
-+AC_CHECK_FUNCS(getpeerucred, AC_DEFINE(HAVE_GETPEERUCRED,1,[Have getpeerucred]))
-+
+
+# Check for pkcs11 library
+#
+AC_CHECK_HEADERS(security/cryptoki.h)
+have_pkcs=no
+AC_CHECK_LIB(pkcs11, C_Initialize, have_pkcs=yes)
+if test $have_pkcs = yes; then
-+ AC_DEFINE(HAVE_PKCS11,1,[Have pkcs11 library])
-+ PKCS_LIBS=-lpkcs11
++ AC_DEFINE(HAVE_PKCS11,1,[Have pkcs11 library])
++ PKCS_LIBS=-lpkcs11
+fi
+AC_SUBST(PKCS_LIBS)
+
-+# Check for /dev/random
-+#
-+AC_CHECK_FILE(/dev/random, AC_DEFINE(HAVE_DEVRANDOM,1,[Have /dev/random]))
-
- dnl ==========================================================================
-
+ # Check for /dev/random
+ #
+ AC_CHECK_FILE(/dev/random, AC_DEFINE(HAVE_DEVRANDOM,1,[Have /dev/random]))
diff -urNp gnome-keyring-0.4.5/gnome-keyring-daemon.c gnome-keyring-0.4.5-hacked/gnome-keyring-daemon.c
--- gnome-keyring-0.4.5/gnome-keyring-daemon.c 2005-05-07 05:13:20.000000000 +1200
+++ gnome-keyring-0.4.5-hacked/gnome-keyring-daemon.c 2005-09-18 21:14:54.064770160 +1200
@@ -65,15 +48,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
-@@ -122,7 +123,7 @@ init_salt (guchar salt[8])
- int i;
-
- got_random = FALSE;
--#ifdef __linux__
-+#ifdef HAVE_DEVRANDOM
- {
- int fd;
-
@@ -297,8 +298,11 @@ hash_string (const char *str)
{
guchar digest[16];
@@ -88,34 +62,6 @@
}
GnomeKeyringAttributeList *
-@@ -1150,7 +1154,8 @@ op_create_item_collect (GString *packet,
-
- if (!gnome_keyring_proto_decode_create_item (packet,
- &keyring_name, NULL,
-- &attributes, NULL, &type,
-+ &attributes, NULL,
-+ (GnomeKeyringItemType *)&type,
- &update_if_exists)) {
- return FALSE;
- }
-@@ -1230,7 +1235,7 @@ op_create_item_execute (GString *packet,
- &display_name,
- &attributes,
- &secret,
-- &type,
-+ (GnomeKeyringItemType *)&type,
- &update_if_exists)) {
- return FALSE;
- }
-@@ -1748,7 +1753,7 @@ op_set_item_info_execute (GString *packe
- if (!gnome_keyring_proto_decode_set_item_info (packet,
- &keyring_name,
- &item_id,
-- &type,
-+ (GnomeKeyringItemType *)&type,
- &item_name,
- &secret)) {
- return FALSE;
diff -urNp gnome-keyring-0.4.5/gnome-keyring-daemon-file.c gnome-keyring-0.4.5-hacked/gnome-keyring-daemon-file.c
--- gnome-keyring-0.4.5/gnome-keyring-daemon-file.c 2005-06-28 11:03:00.000000000 +1200
+++ gnome-keyring-0.4.5-hacked/gnome-keyring-daemon-file.c 2005-09-18 21:18:58.505609504 +1200
@@ -547,35 +493,6 @@
diff -urNp gnome-keyring-0.4.5/gnome-keyring-daemon-io.c gnome-keyring-0.4.5-hacked/gnome-keyring-daemon-io.c
--- gnome-keyring-0.4.5/gnome-keyring-daemon-io.c 2005-09-15 01:58:30.000000000 +1200
+++ gnome-keyring-0.4.5-hacked/gnome-keyring-daemon-io.c 2005-09-18 21:14:54.061770616 +1200
-@@ -33,6 +33,9 @@
- #include <sys/un.h>
- #include <sys/uio.h>
- #include <unistd.h>
-+#if defined(HAVE_GETPEERUCRED)
-+#include <ucred.h>
-+#endif
-
- #include "gnome-keyring.h"
- #include "gnome-keyring-private.h"
-@@ -174,6 +177,18 @@ read_unix_socket_credentials (int fd,
-
- *pid = cred->cmcred_pid;
- *uid = cred->cmcred_euid;
-+#elif defined (HAVE_GETPEERUCRED)
-+ ucred_t *uc = NULL;
-+
-+ if (getpeerucred(fd, &uc) == 0) {
-+ *pid = ucred_getpid(uc);
-+ *uid = ucred_geteuid(uc);
-+ ucred_free(uc);
-+ } else {
-+ g_warning ("getpeerucred() failed: %s", strerror(errno));
-+ return FALSE;
-+ }
-+
- #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
- g_warning ("Socket credentials not supported on this OS\n");
- return FALSE;
@@ -371,10 +386,15 @@ gnome_keyring_client_state_machine (Gnom
gnome_keyring_client_free (client);
return;
@@ -613,17 +530,6 @@
return FALSE;
}
if (!gnome_keyring_proto_end_operation (buffer, op_start)) {
-diff -urNp gnome-keyring-0.4.5/list-keyrings.c gnome-keyring-0.4.5-hacked/list-keyrings.c
---- gnome-keyring-0.4.5/list-keyrings.c 2003-11-29 01:03:40.000000000 +1300
-+++ gnome-keyring-0.4.5-hacked/list-keyrings.c 2005-09-18 21:14:54.065770008 +1200
-@@ -171,6 +171,7 @@ main (int argc, char *argv[])
- gboolean locked;
- guint32 item_id;
-
-+ g_set_application_name("list-keyrings");
- loop = g_main_loop_new (NULL, FALSE);
-
- g_print ("Keyrings:\n");
diff -urNp gnome-keyring-0.4.5/Makefile.am gnome-keyring-0.4.5-hacked/Makefile.am
--- gnome-keyring-0.4.5/Makefile.am 2004-07-21 06:42:50.000000000 +1200
+++ gnome-keyring-0.4.5-hacked/Makefile.am 2005-09-18 21:14:54.067769704 +1200
@@ -844,14 +750,3 @@
#endif
+
+#endif /* !HAVE_PKCS11 */
-diff -urNp gnome-keyring-0.4.5/test.c gnome-keyring-0.4.5-hacked/test.c
---- gnome-keyring-0.4.5/test.c 2005-09-15 01:58:30.000000000 +1200
-+++ gnome-keyring-0.4.5-hacked/test.c 2005-09-18 21:14:54.062770464 +1200
-@@ -301,6 +301,7 @@ main (int argc, char *argv[])
- {
- char arg;
-
-+ g_set_application_name("test-keyring");
- loop = g_main_loop_new (NULL, FALSE);
-
- arg = 0;