[gnome-keyring] [dbus] When no default keyring set, use login keyring.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] [dbus] When no default keyring set, use login keyring.
- Date: Thu, 18 Feb 2010 18:02:45 +0000 (UTC)
commit de56d02feddfd6eb511412a3703774950b791151
Author: Stef Walter <stef memberwebs com>
Date: Thu Feb 18 17:59:32 2010 +0000
[dbus] When no default keyring set, use login keyring.
This is similar to the previous behavior of gnome-keyring-daemon
and also allows us to not set a default keyring when creating
login keyring.
Eventually this and other alias logic, needs to move into the
pkcs11 secrets module.
daemon/dbus/gkd-secret-objects.c | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-objects.c b/daemon/dbus/gkd-secret-objects.c
index d2f52eb..55b1f2d 100644
--- a/daemon/dbus/gkd-secret-objects.c
+++ b/daemon/dbus/gkd-secret-objects.c
@@ -69,15 +69,29 @@ parse_object_path (GkdSecretObjects *self, const gchar *path, gchar **collection
if (g_str_has_prefix (path, SECRET_ALIAS_PREFIX)) {
replace = g_hash_table_lookup (self->aliases, *collection);
- g_free (*collection);
if (!replace) {
- *collection = NULL;
- if (item) {
- g_free (*item);
- *item = NULL;
+
+ /*
+ * TODO: As a special case, always treat login keyring as
+ * default. This logic should be moved, once we have better
+ * support for aliases.
+ */
+
+ if (g_str_equal (*collection, "default")) {
+ replace = "login";
+
+ /* No such alias, return nothing */
+ } else {
+ g_free (*collection);
+ *collection = NULL;
+ if (item) {
+ g_free (*item);
+ *item = NULL;
+ }
+ return FALSE;
}
- return FALSE;
}
+ g_free (*collection);
*collection = g_strdup (replace);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]