From unknown Tue Aug 19 02:51:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20449: secrets-search-items is broken Resent-From: Krzysztof Jurewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Apr 2015 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 20449@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143023571315803 (code B ref -1); Tue, 28 Apr 2015 15:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Apr 2015 15:41:53 +0000 Received: from localhost ([127.0.0.1]:42942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn7dw-00046o-2Y for submit@debbugs.gnu.org; Tue, 28 Apr 2015 11:41:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36802) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn6JY-0001yg-Ub for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn6JS-0000DY-HN for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_SBL_CSS,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JS-0000DU-Ee for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JR-0001y2-BA for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn6JO-0000Cs-17 for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:37 -0400 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:34401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JN-0000Cl-Pl for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:33 -0400 Received: by lbcga7 with SMTP id ga7so108480675lbc.1 for ; Tue, 28 Apr 2015 07:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=50mk3sQKte5CJ2KjGEuO7dfrUlxVRWnbfjwZhd6Zrvs=; b=YYgoF2A87m/CVEoqUqFVFB0bXJas21AwoBV/xADFac0Uk/K0+sddz/Vey3nf+llZSX b9tiDuI0icBSypQHYt+1NOHPjWkKCAC4HHaBGJikjWXRWIIL4k0WOmyal/+tRJlygC4K TrkHFQtU8OM5EFPDuvelDsjAIHyDMcn4OXY3hrTOClbra1+C/eHjgfIgpgtBVfN5LwJi UZLKQTJPEwxVEk/hwZLpksxQZTH/xtDQdvd3AVyDCHqk50XRNQltMp2mNIzg1iCmY7f1 8HicMaLOjRZLAz/uWRyRnpLpiyKBOO6hRFIGlWFBnjhPFVXSkJg0Ejktf7j7bkvK+OLq J/dw== X-Received: by 10.152.36.227 with SMTP id t3mr15022180laj.12.1430230592800; Tue, 28 Apr 2015 07:16:32 -0700 (PDT) Received: from knp ([31.0.2.214]) by mx.google.com with ESMTPSA id j10sm991002lbs.21.2015.04.28.07.16.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 07:16:31 -0700 (PDT) From: Krzysztof Jurewicz Date: Tue, 28 Apr 2015 16:16:30 +0200 Message-ID: <87zj5sl4n5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -0.5 (/) X-Mailman-Approved-At: Tue, 28 Apr 2015 11:41:50 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) 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 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 From unknown Tue Aug 19 02:51:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Krzysztof Jurewicz Subject: bug#20449: closed (Re: bug#20449: secrets-search-items is broken) Message-ID: References: <87egn3e166.fsf@gmx.de> <87zj5sl4n5.fsf@gmail.com> X-Gnu-PR-Message: they-closed 20449 X-Gnu-PR-Package: emacs Reply-To: 20449@debbugs.gnu.org Date: Wed, 29 Apr 2015 09:26:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1430299563-22085-1" This is a multi-part message in MIME format... ------------=_1430299563-22085-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20449: secrets-search-items is broken which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 20449@debbugs.gnu.org. --=20 20449: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20449 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1430299563-22085-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20449-done) by debbugs.gnu.org; 29 Apr 2015 09:25:49 +0000 Received: from localhost ([127.0.0.1]:55583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnOFZ-0005jo-4a for submit@debbugs.gnu.org; Wed, 29 Apr 2015 05:25:49 -0400 Received: from mout.gmx.net ([212.227.15.18]:64089) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnOFW-0005jY-1q for 20449-done@debbugs.gnu.org; Wed, 29 Apr 2015 05:25:46 -0400 Received: from detlef.gmx.de ([87.146.36.12]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lw2Sj-1ZLgkx3Hv3-017nNG; Wed, 29 Apr 2015 11:25:38 +0200 From: Michael Albinus To: Krzysztof Jurewicz Subject: Re: bug#20449: secrets-search-items is broken References: <87zj5sl4n5.fsf@gmail.com> Date: Wed, 29 Apr 2015 11:25:37 +0200 In-Reply-To: <87zj5sl4n5.fsf@gmail.com> (Krzysztof Jurewicz's message of "Tue, 28 Apr 2015 16:16:30 +0200") Message-ID: <87egn3e166.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:2S++RZ5s/2A3bWvO4y3loJ4XSw5VVeNeAV0qH6Px5rwdOKdbdyy zcj/r9+s9CEwgnq7L/e3Wij26G8nyj1taQmX0gTVCiV72TUNnmPKjsnPi7JuATdrZ84l/0W WiyCs6THxQHbKy0XGC9AN1qChSifE4VLTbr9tqimclcsSJ1M0Fsy73Opn0f5TDoHsvd/X1h TB2GhzukaYO2V4ZMFImcQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20449-done Cc: 20449-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Krzysztof Jurewicz 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=3D695115 . 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=E2=80=99 > docstring. Yep. I've corrected also another stupid docstring error there. Best regards, Michael. ------------=_1430299563-22085-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Apr 2015 15:41:53 +0000 Received: from localhost ([127.0.0.1]:42942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn7dw-00046o-2Y for submit@debbugs.gnu.org; Tue, 28 Apr 2015 11:41:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36802) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn6JY-0001yg-Ub for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn6JS-0000DY-HN for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_SBL_CSS,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JS-0000DU-Ee for submit@debbugs.gnu.org; Tue, 28 Apr 2015 10:16:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JR-0001y2-BA for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn6JO-0000Cs-17 for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:37 -0400 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:34401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn6JN-0000Cl-Pl for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 10:16:33 -0400 Received: by lbcga7 with SMTP id ga7so108480675lbc.1 for ; Tue, 28 Apr 2015 07:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=50mk3sQKte5CJ2KjGEuO7dfrUlxVRWnbfjwZhd6Zrvs=; b=YYgoF2A87m/CVEoqUqFVFB0bXJas21AwoBV/xADFac0Uk/K0+sddz/Vey3nf+llZSX b9tiDuI0icBSypQHYt+1NOHPjWkKCAC4HHaBGJikjWXRWIIL4k0WOmyal/+tRJlygC4K TrkHFQtU8OM5EFPDuvelDsjAIHyDMcn4OXY3hrTOClbra1+C/eHjgfIgpgtBVfN5LwJi UZLKQTJPEwxVEk/hwZLpksxQZTH/xtDQdvd3AVyDCHqk50XRNQltMp2mNIzg1iCmY7f1 8HicMaLOjRZLAz/uWRyRnpLpiyKBOO6hRFIGlWFBnjhPFVXSkJg0Ejktf7j7bkvK+OLq J/dw== X-Received: by 10.152.36.227 with SMTP id t3mr15022180laj.12.1430230592800; Tue, 28 Apr 2015 07:16:32 -0700 (PDT) Received: from knp ([31.0.2.214]) by mx.google.com with ESMTPSA id j10sm991002lbs.21.2015.04.28.07.16.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 07:16:31 -0700 (PDT) From: Krzysztof Jurewicz To: bug-gnu-emacs@gnu.org Subject: secrets-search-items is broken Date: Tue, 28 Apr 2015 16:16:30 +0200 Message-ID: <87zj5sl4n5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 28 Apr 2015 11:41:50 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) 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 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 ------------=_1430299563-22085-1--