From: Krzysztof Jurewicz Date: Wed, 29 Apr 2015 09:18:08 +0000 (+0200) Subject: Fix DBUS query result parsing for secrets-search-items X-Git-Tag: emacs-25.0.90~2257 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7fbdb57f801159618f761b8dd510516575b6c5b2;p=emacs.git Fix DBUS query result parsing for secrets-search-items * 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 --- 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.