[gnome-keyring] daemon: Fix regressions in GckAttributes handling
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] daemon: Fix regressions in GckAttributes handling
- Date: Mon, 19 Dec 2011 11:14:34 +0000 (UTC)
commit 458e94a557cdc796110b44ee3d2dfc0f786ea244
Author: Stef Walter <stefw collabora co uk>
Date: Mon Dec 19 12:14:09 2011 +0100
daemon: Fix regressions in GckAttributes handling
daemon/dbus/gkd-secret-change.c | 13 +++++++------
daemon/dbus/gkd-secret-create.c | 1 -
daemon/gpg-agent/gkd-gpg-agent-ops.c | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-change.c b/daemon/dbus/gkd-secret-change.c
index 4afb489..10a0725 100644
--- a/daemon/dbus/gkd-secret-change.c
+++ b/daemon/dbus/gkd-secret-change.c
@@ -454,26 +454,27 @@ gkd_secret_change_with_secrets (GckObject *collection,
gck_builder_add_boolean (&builder, CKA_TOKEN, FALSE);
attrs = gck_attributes_ref_sink (gck_builder_end (&builder));
mcred = gkd_secret_session_create_credential (master->session, session, attrs, master, error);
- if (mcred == NULL)
- goto cleanup;
-
gck_builder_add_all (&builder, attrs);
gck_attributes_unref (attrs);
+ if (mcred == NULL)
+ goto cleanup;
+
/* Create the original credential, in order to make sure we can the collection */
if (original) {
gck_builder_add_ulong (&builder, CKA_G_OBJECT, gck_object_get_handle (collection));
attrs = gck_attributes_ref_sink (gck_builder_end (&builder));
ocred = gkd_secret_session_create_credential (original->session, session, attrs, original, error);
+ gck_attributes_unref (attrs);
+
if (ocred == NULL)
goto cleanup;
}
- gck_attributes_unref (attrs);
gck_builder_add_ulong (&builder, CKA_G_CREDENTIAL, gck_object_get_handle (mcred));
/* Now set the collection credentials to the first one */
- result = gck_object_set (collection, attrs, NULL, error);
+ result = gck_object_set (collection, gck_builder_end (&builder), NULL, error);
cleanup:
if (ocred) {
@@ -488,6 +489,6 @@ cleanup:
g_object_unref (mcred);
}
- gck_attributes_unref (attrs);
+ gck_builder_clear (&builder);
return result;
}
diff --git a/daemon/dbus/gkd-secret-create.c b/daemon/dbus/gkd-secret-create.c
index b700931..2c8c9f5 100644
--- a/daemon/dbus/gkd-secret-create.c
+++ b/daemon/dbus/gkd-secret-create.c
@@ -457,7 +457,6 @@ gkd_secret_create_with_secret (GckAttributes *attrs,
collection = gkd_secret_create_with_credential (session, attrs, cred, error);
- gck_attributes_unref (atts);
g_object_unref (cred);
if (collection == NULL)
diff --git a/daemon/gpg-agent/gkd-gpg-agent-ops.c b/daemon/gpg-agent/gkd-gpg-agent-ops.c
index 154e172..8f4e7ef 100644
--- a/daemon/gpg-agent/gkd-gpg-agent-ops.c
+++ b/daemon/gpg-agent/gkd-gpg-agent-ops.c
@@ -199,15 +199,15 @@ do_save_password (GckSession *session, const gchar *keyid, const gchar *descript
gck_list_unref_free (previous);
}
- gck_attributes_unref (attrs);
-
text = calculate_label_for_key (keyid, description);
label = g_strdup_printf (_("PGP Key: %s"), text);
g_free (text);
/* Put in the remainder of the attributes */
+ gck_builder_add_all (&builder, attrs);
gck_builder_add_string (&builder, CKA_VALUE, password);
gck_builder_add_string (&builder, CKA_LABEL, label);
+ gck_attributes_unref (attrs);
g_free (label);
item = gck_session_create_object (session, gck_builder_end (&builder), NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]