rpms/libgnome-keyring/devel libgnome-keyring-2.29.5-acl-assertion.patch, NONE, 1.1 libgnome-keyring-2.29.5-session-clear.patch, NONE, 1.1 libgnome-keyring-2.29.5-set-info-type-property.patch, NONE, 1.1 libgnome-keyring.spec, 1.1, 1.2
Tomas Bzatek
tbzatek at fedoraproject.org
Mon Jan 25 17:12:09 UTC 2010
- Previous message: rpms/system-config-printer/devel system-config-printer-lpd-model.patch, NONE, 1.1 system-config-printer.spec, 1.353, 1.354 clog1, 1.7, NONE
- Next message: rpms/php-pear-Log/devel .cvsignore, 1.18, 1.19 php-pear-Log.spec, 1.21, 1.22 sources, 1.18, 1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: tbzatek
Update of /cvs/extras/rpms/libgnome-keyring/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3240
Modified Files:
libgnome-keyring.spec
Added Files:
libgnome-keyring-2.29.5-acl-assertion.patch
libgnome-keyring-2.29.5-session-clear.patch
libgnome-keyring-2.29.5-set-info-type-property.patch
Log Message:
* Mon Jan 25 2010 Tomas Bzatek <tbzatek at redhat.com> - 2.29.4-2
- Fix assertion calling deprecated acl function
- Clear the client's session when the service disconnects
- Implement setting of Type property in gnome_keyring_item_set_info()
libgnome-keyring-2.29.5-acl-assertion.patch:
gnome-keyring.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- NEW FILE libgnome-keyring-2.29.5-acl-assertion.patch ---
>From 604de15586fea8adaa06a0a6a2090002a068ec98 Mon Sep 17 00:00:00 2001
From: Stef Walter <stef at memberwebs.com>
Date: Sun, 03 Jan 2010 01:03:05 +0000
Subject: Fix assertion calling deprecated acl function.
---
diff --git a/library/gnome-keyring.c b/library/gnome-keyring.c
index 2cf8a40..be49a6f 100644
--- a/library/gnome-keyring.c
+++ b/library/gnome-keyring.c
@@ -3381,6 +3381,13 @@ gnome_keyring_item_set_attributes_sync (const char *keyring,
return gkr_operation_block (op);
}
+static void
+item_get_acl_reply (GnomeKeyringResult res, gpointer user_data)
+{
+ GkrCallback *cb = user_data;
+ gkr_callback_invoke_ok_list (cb, NULL);
+}
+
/**
* gnome_keyring_item_get_acl:
* @keyring: The name of the keyring in which the item exists, or NULL for the default keyring.
@@ -3401,7 +3408,9 @@ gnome_keyring_item_get_acl (const char *keyring,
GDestroyNotify destroy_data)
{
GkrOperation *op;
- op = gkr_operation_new (callback, GKR_CALLBACK_RES_LIST, data, destroy_data);
+ GkrCallback *cb;
+ cb = gkr_callback_new (NULL, callback, GKR_CALLBACK_RES_LIST, data, destroy_data);
+ op = gkr_operation_new (item_get_acl_reply, GKR_CALLBACK_RES, cb, gkr_callback_free);
gkr_operation_complete_later (op, GNOME_KEYRING_RESULT_OK);
gkr_operation_unref (op);
return op;
--
cgit v0.8.3.1
libgnome-keyring-2.29.5-session-clear.patch:
gkr-operation.c | 33 ++++++++++++++++++++++++++++++++-
gkr-session.c | 13 +++++++++++++
gkr-session.h | 3 ++-
3 files changed, 47 insertions(+), 2 deletions(-)
--- NEW FILE libgnome-keyring-2.29.5-session-clear.patch ---
>From 48b8a75059b05d6f1b8e7e040e811d8429f514f5 Mon Sep 17 00:00:00 2001
From: Stef Walter <stef at memberwebs.com>
Date: Sun, 03 Jan 2010 02:09:45 +0000
Subject: Clear the client's session when the service disconnects.
---
diff --git a/library/gkr-operation.c b/library/gkr-operation.c
index 4f36763..ebc93d6 100644
--- a/library/gkr-operation.c
+++ b/library/gkr-operation.c
@@ -27,6 +27,7 @@
#include "gkr-misc.h"
#include "gkr-operation.h"
+#include "gkr-session.h"
#include "gnome-keyring.h"
#include "gnome-keyring-private.h"
@@ -216,6 +217,33 @@ gkr_operation_complete_later (GkrOperation *op, GnomeKeyringResult res)
gkr_operation_ref (op), gkr_operation_unref);
}
+static DBusHandlerResult
+on_name_changed_filter (DBusConnection *connection, DBusMessage *message, void *user_data)
+{
+ const char *object_name;
+ const char *new_owner;
+ const char *old_owner;
+
+ /* org.freedesktop.DBus.NameOwnerChanged(STRING name, STRING old_owner, STRING new_owner) */
+ if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged") &&
+ dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &object_name,
+ DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner,
+ DBUS_TYPE_INVALID)) {
+
+ /* See if it's the secret service going away */
+ if (object_name && g_str_equal (SECRETS_SERVICE, object_name) &&
+ new_owner && g_str_equal ("", new_owner)) {
+
+ /* Clear any session, when the service goes away */
+ gkr_session_clear ();
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
static DBusConnection*
connect_to_service (void)
{
@@ -245,18 +273,21 @@ connect_to_service (void)
rule = "type='signal',interface='org.gnome.secrets.Prompt',member='Completed'";
dbus_bus_add_match (conn, rule, NULL);
+ /* Listen for name owner changed signals */
rule = "type='signal',member='NameOwnerChanged',interface='org.freedesktop.DBus'";
dbus_bus_add_match (conn, rule, NULL);
+ dbus_connection_add_filter (conn, on_name_changed_filter, NULL, NULL);
G_LOCK (dbus_connection);
{
if (dbus_connection) {
- dbus_connection_unref (dbus_connection);
+ dbus_connection_unref (conn);
} else {
egg_dbus_connect_with_mainloop (conn, NULL);
dbus_connection = conn;
}
}
+ G_UNLOCK (dbus_connection);
}
return dbus_connection_ref (dbus_connection);
diff --git a/library/gkr-session.c b/library/gkr-session.c
index ed1480d..f5b4c81 100644
--- a/library/gkr-session.c
+++ b/library/gkr-session.c
@@ -379,6 +379,19 @@ gkr_session_negotiate (GkrOperation *op)
session_negotiate_aes (op);
}
+void
+gkr_session_clear (void)
+{
+ G_LOCK (session_globals);
+ {
+ if (the_session) {
+ gkr_session_unref (the_session);
+ the_session = NULL;
+ }
+ }
+ G_UNLOCK (session_globals);
+}
+
static gboolean
session_encode_secret (DBusMessageIter *iter, const gchar *path, gconstpointer parameter,
gsize n_parameter, gconstpointer secret, gsize n_secret)
diff --git a/library/gkr-session.h b/library/gkr-session.h
index c6f02b3..e3a0632 100644
--- a/library/gkr-session.h
+++ b/library/gkr-session.h
@@ -28,6 +28,8 @@
void gkr_session_negotiate (GkrOperation *op);
+void gkr_session_clear (void);
+
GkrSession* gkr_session_ref (GkrSession *session);
void gkr_session_unref (gpointer data);
--
cgit v0.8.3.1
libgnome-keyring-2.29.5-set-info-type-property.patch:
gnome-keyring.c | 107 ++++++++++++++++++++++++++++++++++----------------------
1 file changed, 65 insertions(+), 42 deletions(-)
--- NEW FILE libgnome-keyring-2.29.5-set-info-type-property.patch ---
>From c04283e31e4084025768f5df23db9ed5a1cf2a48 Mon Sep 17 00:00:00 2001
From: Stef Walter <stef at memberwebs.com>
Date: Mon, 04 Jan 2010 01:29:38 +0000
Subject: Implement setting of Type property in gnome_keyring_item_set_info().
---
diff --git a/library/gnome-keyring.c b/library/gnome-keyring.c
index be49a6f..e58ef21 100644
--- a/library/gnome-keyring.c
+++ b/library/gnome-keyring.c
@@ -2796,10 +2796,8 @@ static gboolean
item_get_info_foreach (const gchar *property, DBusMessageIter *iter, gpointer user_data)
{
GnomeKeyringItemInfo *info = user_data;
- DBusMessageIter array, dict;
const char *sval;
dbus_int64_t i64val;
- int type;
if (g_str_equal (property, "Label")) {
if (dbus_message_iter_get_arg_type (iter) != DBUS_TYPE_STRING)
@@ -2819,41 +2817,25 @@ item_get_info_foreach (const gchar *property, DBusMessageIter *iter, gpointer us
dbus_message_iter_get_basic (iter, &i64val);
info->ctime = (time_t)i64val;
- } else if (g_str_equal (property, "Attributes")) {
- if (dbus_message_iter_get_arg_type (iter) != DBUS_TYPE_ARRAY)
+ } else if (g_str_equal (property, "Type")) {
+ if (dbus_message_iter_get_arg_type (iter) != DBUS_TYPE_STRING)
return FALSE;
- dbus_message_iter_recurse (iter, &array);
- for (;;) {
- type = dbus_message_iter_get_arg_type (&array);
- if (type == DBUS_TYPE_INVALID)
- break;
- else if (type != DBUS_TYPE_DICT_ENTRY)
- return FALSE;
- dbus_message_iter_recurse (&array, &dict);
- if (dbus_message_iter_get_arg_type (&dict) != DBUS_TYPE_STRING)
- return FALSE;
- dbus_message_iter_get_basic (&dict, &sval);
- if (g_str_equal ("gkr:item-type", sval)) {
- if (!dbus_message_iter_next (&dict) ||
- dbus_message_iter_get_arg_type (&dict) != DBUS_TYPE_STRING)
- return FALSE;
- dbus_message_iter_get_basic (&dict, &sval);
- if (g_str_equal (sval, "generic-secret"))
- info->type = GNOME_KEYRING_ITEM_GENERIC_SECRET;
- else if (g_str_equal (sval, "network-password"))
- info->type = GNOME_KEYRING_ITEM_NETWORK_PASSWORD;
- else if (g_str_equal (sval, "note"))
- info->type = GNOME_KEYRING_ITEM_NOTE;
- else if (g_str_equal (sval, "chained-keyring-password"))
- info->type = GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD;
- else if (g_str_equal (sval, "encryption-key-password"))
- info->type = GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD;
- else if (g_str_equal (sval, "pk-storage"))
- info->type = GNOME_KEYRING_ITEM_PK_STORAGE;
- }
-
- dbus_message_iter_next (&array);
- }
+ dbus_message_iter_get_basic (iter, &sval);
+ g_return_val_if_fail (sval, FALSE);
+ if (g_str_equal (sval, "org.freedesktop.Secret.Generic"))
+ info->type = GNOME_KEYRING_ITEM_GENERIC_SECRET;
+ else if (g_str_equal (sval, "org.gnome.keyring.NetworkPassword"))
+ info->type = GNOME_KEYRING_ITEM_NETWORK_PASSWORD;
+ else if (g_str_equal (sval, "org.gnome.keyring.Note"))
+ info->type = GNOME_KEYRING_ITEM_NOTE;
+ else if (g_str_equal (sval, "org.gnome.keyring.ChainedKeyring"))
+ info->type = GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD;
+ else if (g_str_equal (sval, "org.gnome.keyring.EncryptionKey"))
+ info->type = GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD;
+ else if (g_str_equal (sval, "org.gnome.keyring.PkStorage"))
+ info->type = GNOME_KEYRING_ITEM_PK_STORAGE;
+ else
+ info->type = GNOME_KEYRING_ITEM_GENERIC_SECRET;
}
return TRUE;
@@ -3064,7 +3046,7 @@ item_set_info_free (gpointer data)
}
static void
-item_set_info_2_reply (GkrOperation *op, GkrSession *session, gpointer user_data)
+item_set_info_3_reply (GkrOperation *op, GkrSession *session, gpointer user_data)
{
item_set_info_args *args = user_data;
DBusMessageIter iter;
@@ -3091,18 +3073,16 @@ item_set_info_2_reply (GkrOperation *op, GkrSession *session, gpointer user_data
}
static void
-item_set_info_1_reply (GkrOperation *op, DBusMessage *reply, gpointer user_data)
+item_set_info_2_reply (GkrOperation *op, DBusMessage *reply, gpointer user_data)
{
item_set_info_args *args = user_data;
if (gkr_operation_handle_errors (op, reply))
return;
- /* TODO: No way to set item 'type' easily, so we skip for now */
-
/* Need a session to send a secret */
if (args->info->secret) {
- gkr_operation_push (op, item_set_info_2_reply, GKR_CALLBACK_OP_SESSION, args, NULL);
+ gkr_operation_push (op, item_set_info_3_reply, GKR_CALLBACK_OP_SESSION, args, NULL);
gkr_session_negotiate (op);
/* No secret? all done */
@@ -3111,6 +3091,50 @@ item_set_info_1_reply (GkrOperation *op, DBusMessage *reply, gpointer user_data)
}
}
+static void
+item_set_info_1_reply (GkrOperation *op, DBusMessage *reply, gpointer user_data)
+{
+ item_set_info_args *args = user_data;
+ DBusMessageIter iter, variant;
+ DBusMessage *req;
+ const char *string;
+
+ if (gkr_operation_handle_errors (op, reply))
+ return;
+
+ /* Next set the type */
+ req = dbus_message_new_method_call (SECRETS_SERVICE, args->path,
+ DBUS_INTERFACE_PROPERTIES, "Set");
+
+ dbus_message_iter_init_append (req, &iter);
+ string = ITEM_INTERFACE;
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &string);
+ string = "Type";
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &string);
+ dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, "s", &variant);
+
+ if (args->info->type == GNOME_KEYRING_ITEM_GENERIC_SECRET)
+ string = "org.freedesktop.Secret.Generic";
+ else if (args->info->type == GNOME_KEYRING_ITEM_NETWORK_PASSWORD)
+ string = "org.gnome.keyring.NetworkPassword";
+ else if (args->info->type == GNOME_KEYRING_ITEM_NOTE)
+ string = "org.gnome.keyring.Note";
+ else if (args->info->type == GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD)
+ string = "org.gnome.keyring.ChainedKeyring";
+ else if (args->info->type == GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD)
+ string = "org.gnome.keyring.EncryptionKey";
+ else if (args->info->type == GNOME_KEYRING_ITEM_PK_STORAGE)
+ string = "org.gnome.keyring.PkStorage";
+ else
+ string = "org.freedesktop.Secret.Generic";
+
+ dbus_message_iter_append_basic (&variant, DBUS_TYPE_STRING, &string);
+ dbus_message_iter_close_container (&iter, &variant);
+
+ gkr_operation_push (op, item_set_info_2_reply, GKR_CALLBACK_OP_MSG, args, NULL);
+ gkr_operation_request (op, req);
+}
+
/**
* gnome_keyring_item_set_info:
* @keyring: The name of the keyring in which the item exists, or NULL for the default keyring.
--
cgit v0.8.3.1
Index: libgnome-keyring.spec
===================================================================
RCS file: /cvs/extras/rpms/libgnome-keyring/devel/libgnome-keyring.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- libgnome-keyring.spec 7 Jan 2010 10:16:37 -0000 1.1
+++ libgnome-keyring.spec 25 Jan 2010 17:12:09 -0000 1.2
@@ -6,7 +6,7 @@
Summary: Framework for managing passwords and other secrets
Name: libgnome-keyring
Version: 2.29.4
-Release: 1%{?dist}
+Release: 2%{?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
@@ -20,6 +20,12 @@ BuildRequires: libgcrypt-devel >= %{gcry
BuildRequires: intltool
Conflicts: gnome-keyring < 2.29.4
+
+# from upstream
+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
+
%description
gnome-keyring is a program that keep password and other secrets for
users. The library libgnome-keyring is used by applications to integrate
@@ -42,6 +48,10 @@ header files needed to develop applicati
%prep
%setup -q -n libgnome-keyring-%{version}
+%patch0 -p1 -b .acl-assertion
+%patch1 -p1 -b .session-clear
+%patch2 -p1 -b .info-type
+
%build
%configure --disable-gtk-doc
@@ -82,5 +92,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Jan 25 2010 Tomas Bzatek <tbzatek at redhat.com> - 2.29.4-2
+- Fix assertion calling deprecated acl function
+- Clear the client's session when the service disconnects
+- Implement setting of Type property in gnome_keyring_item_set_info()
+
* Thu Jan 7 2010 Tomas Bzatek <tbzatek at redhat.com> - 2.29.4-1
- Initial packaging
- Previous message: rpms/system-config-printer/devel system-config-printer-lpd-model.patch, NONE, 1.1 system-config-printer.spec, 1.353, 1.354 clog1, 1.7, NONE
- Next message: rpms/php-pear-Log/devel .cvsignore, 1.18, 1.19 php-pear-Log.spec, 1.21, 1.22 sources, 1.18, 1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list