64 lines
1.8 KiB
Diff
64 lines
1.8 KiB
Diff
|
From 4d22df25dac5c051c04f8d957169ff5ba45b5020 Mon Sep 17 00:00:00 2001
|
||
|
From: Stef Walter <stef@memberwebs.com>
|
||
|
Date: Sat, 06 Feb 2010 15:06:16 +0000
|
||
|
Subject: [dbus] Refresh and store the default keyring correctly.
|
||
|
|
||
|
Although the default keyring was being loaded, it was not being
|
||
|
used correctly by the path resolution code.
|
||
|
---
|
||
|
diff --git a/daemon/dbus/gkd-secret-service.c b/daemon/dbus/gkd-secret-service.c
|
||
|
index 4e2b01c..3d5bd19 100644
|
||
|
--- a/daemon/dbus/gkd-secret-service.c
|
||
|
+++ b/daemon/dbus/gkd-secret-service.c
|
||
|
@@ -56,7 +56,6 @@ struct _GkdSecretService {
|
||
|
GHashTable *clients;
|
||
|
gchar *match_rule;
|
||
|
GkdSecretObjects *objects;
|
||
|
- gchar *default_collection;
|
||
|
};
|
||
|
|
||
|
typedef struct _ServiceClient {
|
||
|
@@ -88,9 +87,11 @@ static void
|
||
|
update_default (GkdSecretService *self, gboolean force)
|
||
|
{
|
||
|
gchar *contents = NULL;
|
||
|
+ const gchar *identifier;
|
||
|
gchar *path;
|
||
|
|
||
|
- if (!force && self->default_collection)
|
||
|
+ identifier = gkd_secret_objects_get_alias (self->objects, "default");
|
||
|
+ if (!force && identifier)
|
||
|
return;
|
||
|
|
||
|
path = default_path ();
|
||
|
@@ -103,21 +104,23 @@ update_default (GkdSecretService *self, gboolean force)
|
||
|
}
|
||
|
g_free (path);
|
||
|
|
||
|
- g_free (self->default_collection);
|
||
|
- self->default_collection = contents;
|
||
|
+ gkd_secret_objects_set_alias (self->objects, "default", contents);
|
||
|
+ g_free (contents);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
store_default (GkdSecretService *self)
|
||
|
{
|
||
|
GError *error = NULL;
|
||
|
+ const gchar *identifier;
|
||
|
gchar *path;
|
||
|
|
||
|
- if (!self->default_collection)
|
||
|
+ identifier = gkd_secret_objects_get_alias (self->objects, "default");
|
||
|
+ if (!identifier)
|
||
|
return;
|
||
|
|
||
|
path = default_path ();
|
||
|
- if (!g_file_set_contents (path, self->default_collection, -1, &error)) {
|
||
|
+ if (!g_file_set_contents (path, identifier, -1, &error)) {
|
||
|
g_message ("couldn't store default keyring: %s",
|
||
|
error->message ? error->message : "");
|
||
|
}
|
||
|
--
|
||
|
cgit v0.8.3.1
|