[gnome-keyring/dbus-api] [dbus] Fix encoding of secret into dbus message.



commit 2d3dc9b843f2564c083aa8cb46fd322f52d4f9fc
Author: Stef Walter <stef memberwebs com>
Date:   Sat Dec 12 22:42:34 2009 +0000

    [dbus] Fix encoding of secret into dbus message.

 daemon/dbus/gkd-secret-secret.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-secret.c b/daemon/dbus/gkd-secret-secret.c
index d1202d9..8434015 100644
--- a/daemon/dbus/gkd-secret-secret.c
+++ b/daemon/dbus/gkd-secret-secret.c
@@ -85,15 +85,19 @@ gkd_secret_secret_parse (DBusMessageIter *iter)
 void
 gkd_secret_secret_append (GkdSecretSecret *secret, DBusMessageIter *iter)
 {
-	DBusMessageIter struc;
+	DBusMessageIter struc, array;
 	int length;
 
-	dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, "oayay", &struc);
-	dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &(secret->path));
+	dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, NULL, &struc);
+	dbus_message_iter_append_basic (&struc, DBUS_TYPE_OBJECT_PATH, &(secret->path));
+	dbus_message_iter_open_container (&struc, DBUS_TYPE_ARRAY, "y", &array);
 	length = secret->n_parameter;
-	dbus_message_iter_append_fixed_array (iter, DBUS_TYPE_BYTE, &(secret->parameter), length);
+	dbus_message_iter_append_fixed_array (&array, DBUS_TYPE_BYTE, &(secret->parameter), length);
+	dbus_message_iter_close_container (&struc, &array);
+	dbus_message_iter_open_container (&struc, DBUS_TYPE_ARRAY, "y", &array);
 	length = secret->n_value;
-	dbus_message_iter_append_fixed_array (iter, DBUS_TYPE_BYTE, &(secret->value), length);
+	dbus_message_iter_append_fixed_array (&array, DBUS_TYPE_BYTE, &(secret->value), length);
+	dbus_message_iter_close_container (&struc, &array);
 	dbus_message_iter_close_container (iter, &struc);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]