GNU bug report logs -
#20449
secrets-search-items is broken
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 29 Apr 2015 11:25:37 +0200
with message-id <87egn3e166.fsf <at> gmx.de>
and subject line Re: bug#20449: secrets-search-items is broken
has caused the debbugs.gnu.org bug report #20449,
regarding secrets-search-items is broken
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
20449: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20449
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 <krzysztof.jurewicz <at> gmail.com>
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
[Message part 3 (message/rfc822, inline)]
Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com> 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.
This bug report was last modified 10 years and 87 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.