1 |
nirbheek 13/03/02 08:51:22 |
2 |
|
3 |
Added: libsecret-0.13-fix-secretvalue-get.patch |
4 |
Log: |
5 |
Bump to 0.13, add a patch from git to fix SecretValue annotations |
6 |
|
7 |
(Portage version: 2.2.0_alpha162/cvs/Linux x86_64, signed Manifest commit with key 560FDD64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-crypt/libsecret/files/libsecret-0.13-fix-secretvalue-get.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/libsecret/files/libsecret-0.13-fix-secretvalue-get.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-crypt/libsecret/files/libsecret-0.13-fix-secretvalue-get.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: libsecret-0.13-fix-secretvalue-get.patch |
16 |
=================================================================== |
17 |
From ddd9bdd2e9fcc6009e54a17751d1002a039d180a Mon Sep 17 00:00:00 2001 |
18 |
From: Stef Walter <stefw@×××××.org> |
19 |
Date: Mon, 25 Feb 2013 13:56:32 +0100 |
20 |
Subject: [PATCH] Fix introspection for secret_value_get() to return a uint8 |
21 |
|
22 |
This works around a crash in pygobject. |
23 |
|
24 |
https://bugzilla.gnome.org/show_bug.cgi?id=694448 |
25 |
--- |
26 |
libsecret/secret-value.c | 4 ++-- |
27 |
libsecret/tests/test-unstable.py | 34 +++++++++++++++++++++++++++++++--- |
28 |
2 files changed, 33 insertions(+), 5 deletions(-) |
29 |
|
30 |
diff --git a/libsecret/secret-value.c b/libsecret/secret-value.c |
31 |
index 7bd7bc2..a6fc5b8 100644 |
32 |
--- a/libsecret/secret-value.c |
33 |
+++ b/libsecret/secret-value.c |
34 |
@@ -151,13 +151,13 @@ secret_value_new_full (gchar *secret, |
35 |
/** |
36 |
* secret_value_get: |
37 |
* @value: the value |
38 |
- * @length: (out): the length of the secret |
39 |
+ * @length: the length of the secret |
40 |
* |
41 |
* Get the secret data in the #SecretValue. The value is not necessarily |
42 |
* null-terminated unless it was created with secret_value_new() or a |
43 |
* null-terminated string was passed to secret_value_new_full(). |
44 |
* |
45 |
- * Returns: (array length=length): the secret data |
46 |
+ * Returns: (array length=length) (element-type guint8): the secret data |
47 |
*/ |
48 |
const gchar * |
49 |
secret_value_get (SecretValue *value, |
50 |
diff --git a/libsecret/tests/test-unstable.py b/libsecret/tests/test-unstable.py |
51 |
index 7f611e7..2aa6d2b 100644 |
52 |
--- a/libsecret/tests/test-unstable.py |
53 |
+++ b/libsecret/tests/test-unstable.py |
54 |
@@ -14,22 +14,50 @@ |
55 |
import unittest |
56 |
|
57 |
from gi.repository import MockService as Mock |
58 |
-from gi.repository import SecretUnstable as Secret, GLib |
59 |
+from gi.repository import SecretUnstable, Secret, GLib |
60 |
+ |
61 |
+EXAMPLE_SCHEMA = Secret.Schema.new('org.mock.type.Store', |
62 |
+ Secret.SchemaFlags.NONE, |
63 |
+ { |
64 |
+ 'number': Secret.SchemaAttributeType.INTEGER, |
65 |
+ 'string': Secret.SchemaAttributeType.STRING, |
66 |
+ 'even': Secret.SchemaAttributeType.BOOLEAN, |
67 |
+ } |
68 |
+) |
69 |
+ |
70 |
+attributes = { |
71 |
+ 'number': '8', |
72 |
+ 'string': 'eight', |
73 |
+ 'even': 'true' |
74 |
+} |
75 |
|
76 |
class TestStore(unittest.TestCase): |
77 |
def setUp(self): |
78 |
Mock.start("mock-service-normal.py") |
79 |
|
80 |
def tearDown(self): |
81 |
- Secret.Service.disconnect() |
82 |
+ SecretUnstable.Service.disconnect() |
83 |
Mock.stop() |
84 |
|
85 |
def testSynchronous(self): |
86 |
- service = Secret.Service.get_sync(Secret.ServiceFlags.NONE, None); |
87 |
+ service = SecretUnstable.Service.get_sync(SecretUnstable.ServiceFlags.NONE, None); |
88 |
path = service.read_alias_dbus_path_sync("default", None); |
89 |
|
90 |
# Just running this without error is good enough for us to test the unstable gir |
91 |
self.assertNotEqual(path, None); |
92 |
|
93 |
+ def testValueGet(self): |
94 |
+ Secret.password_store_sync(EXAMPLE_SCHEMA, attributes, Secret.COLLECTION_DEFAULT, |
95 |
+ 'the label', 'the password', None) |
96 |
+ |
97 |
+ service = SecretUnstable.Service.get_sync(SecretUnstable.ServiceFlags.NONE, None) |
98 |
+ items = service.search_sync(EXAMPLE_SCHEMA, { 'even': 'true' }, |
99 |
+ SecretUnstable.SearchFlags.ALL | SecretUnstable.SearchFlags.LOAD_SECRETS, |
100 |
+ None) |
101 |
+ |
102 |
+ item = items[0] |
103 |
+ item_secret = item.get_secret() |
104 |
+ self.assertEqual(item_secret.get(), "the password") |
105 |
+ |
106 |
if __name__ == '__main__': |
107 |
unittest.main() |
108 |
-- |
109 |
1.7.12.4 |