From 7fbdb57f801159618f761b8dd510516575b6c5b2 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Wed, 29 Apr 2015 11:18:08 +0200 Subject: [PATCH] Fix DBUS query result parsing for secrets-search-items MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lisp/net/secrets.el (secrets-search-items): 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. 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. (Bug#20449) Copyright-paperwork-exempt: yes --- lisp/net/secrets.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 6f4e1736937..56cbec4ea75 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -598,10 +598,9 @@ If successful, return the object path of the collection." ATTRIBUTES are key-value pairs. The keys are keyword symbols, starting with a colon. Example: - \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\" - :method \"sudo\" :user \"joe\" :host \"remote-host\"\) + \(secrets-search-items \"Tramp collection\" :user \"joe\") -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 +617,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 +628,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.39.2