--- Begin Message ---
Subject: |
secrets-search-items is broken |
Date: |
Tue, 28 Apr 2015 16:16:30 +0200 |
When one wants to store smtpmail passwords in GNOME keyring, he cannot
retrieve them because secrets-search-items raises an error. A patch
below.
>From dc4c463194d6a944057de1254f59440a65558e37 Mon Sep 17 00:00:00 2001
From: Krzysztof Jurewicz <address@hidden>
Date: Tue, 28 Apr 2015 13:54:48 +0200
Subject: [PATCH] * lisp/net/secrets.el (secrets-search-items):
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix DBUS query result parsing. The function assumed that return value
of the SearchItems method called on a collection is a list of two
lists, however this is true only when no collection is specified:
http://standards.freedesktop.org/secret-service/re01.html#org.freedesktop.Secret.Service.SearchItems
. If a collection is present, a direct list is returned:
http://standards.freedesktop.org/secret-service/re02.html#org.freedesktop.Secret.Collection.SearchItems
. Therefore the squashing performed in secrets-search-items has been
unnecessary, causing an error.
GNOME had used to incorrectly return a list of two lists in both
cases, but this was already fixed:
https://bugzilla.gnome.org/show_bug.cgi?id=695115 .
Also fix an incorrect information in the secrets-search-items’
docstring.
Copyright-paperwork-exempt: yes
---
lisp/net/secrets.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index 6f4e173..1a827b1 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -601,7 +601,7 @@ starting with a colon. Example:
\(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
:method \"sudo\" :user \"joe\" :host \"remote-host\"\)
-The object paths of the found items are returned as list."
+The object labels of the found items are returned as list."
(let ((collection-path (secrets-unlock-collection collection))
result props)
(unless (secrets-empty-path collection-path)
@@ -618,8 +618,7 @@ The object paths of the found items are returned as list."
(cadr attributes))
'append)
attributes (cddr attributes)))
- ;; Search. The result is a list of two lists, the object paths
- ;; of the unlocked and the locked items.
+ ;; Search. The result is a list of object paths.
(setq result
(dbus-call-method
:session secrets-service collection-path
@@ -630,7 +629,7 @@ The object paths of the found items are returned as list."
;; Return the found items.
(mapcar
(lambda (item-path) (secrets-get-item-property item-path "Label"))
- (append (car result) (cadr result))))))
+ result))))
(defun secrets-create-item (collection item password &rest attributes)
"Create a new item in COLLECTION with label ITEM and password PASSWORD.
--
2.3.6
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#20449: secrets-search-items is broken |
Date: |
Wed, 29 Apr 2015 11:25:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Krzysztof Jurewicz <address@hidden> writes:
Hi Krzysztof,
> When one wants to store smtpmail passwords in GNOME keyring, he cannot
> retrieve them because secrets-search-items raises an error. A patch
> below.
>
> GNOME had used to incorrectly return a list of two lists in both
> cases, but this was already fixed:
> https://bugzilla.gnome.org/show_bug.cgi?id=695115 .
Thanks for this! I have pushed it to the master branch, closing the bug.
No we have the problem, that secrets.el won't cooperate any longer with
gnome-keyring versions prior to 2013. But I don't believe we shall
introduce a wrapper in order to hide this; it is obviously an error in
GNOME, and Emacs 25 might not be faced with this too much.
> Also fix an incorrect information in the secrets-search-items’
> docstring.
Yep. I've corrected also another stupid docstring error there.
Best regards, Michael.
--- End Message ---