[gnome-keyring] dbus: Correctly handle alias paths in lookup_collection
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] dbus: Correctly handle alias paths in lookup_collection
- Date: Fri, 23 Oct 2015 11:34:46 +0000 (UTC)
commit 2f5e4db43492c8c15577ca18081d06d1bf38ae60
Author: Dmitry Shachnev <mitya57 ubuntu com>
Date: Wed Oct 21 16:17:14 2015 +0300
dbus: Correctly handle alias paths in lookup_collection
https://bugzilla.gnome.org/show_bug.cgi?id=756865
daemon/dbus/gkd-secret-objects.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-objects.c b/daemon/dbus/gkd-secret-objects.c
index 995c930..90493df 100644
--- a/daemon/dbus/gkd-secret-objects.c
+++ b/daemon/dbus/gkd-secret-objects.c
@@ -1047,6 +1047,7 @@ gkd_secret_objects_lookup_collection (GkdSecretObjects *self, const gchar *calle
GList *objects;
GckSession *session;
gchar *identifier;
+ const gchar *real_identifier;
g_return_val_if_fail (GKD_SECRET_IS_OBJECTS (self), NULL);
g_return_val_if_fail (path, NULL);
@@ -1054,6 +1055,11 @@ gkd_secret_objects_lookup_collection (GkdSecretObjects *self, const gchar *calle
if (!gkd_secret_util_parse_path (path, &identifier, NULL))
return NULL;
+ if (g_str_has_prefix (path, SECRET_ALIAS_PREFIX))
+ real_identifier = gkd_secret_service_get_alias (self->service, identifier);
+ else
+ real_identifier = identifier;
+
/* The session we're using to access the object */
if (caller == NULL)
session = gkd_secret_service_internal_pkcs11_session (self->service);
@@ -1062,7 +1068,7 @@ gkd_secret_objects_lookup_collection (GkdSecretObjects *self, const gchar *calle
g_return_val_if_fail (session, NULL);
gck_builder_add_ulong (&builder, CKA_CLASS, CKO_G_COLLECTION);
- gck_builder_add_string (&builder, CKA_ID, identifier);
+ gck_builder_add_string (&builder, CKA_ID, real_identifier);
objects = gck_session_find_objects (session, gck_builder_end (&builder), NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]