GNU bug report logs - #20541
ERC password fetching using Secret Service API is broken

Previous Next

Package: emacs;

Reported by: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>

Date: Sun, 10 May 2015 14:15:03 UTC

Severity: normal

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20541 in the body.
You can then email your comments to 20541 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20541; Package emacs. (Sun, 10 May 2015 14:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 10 May 2015 14:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: ERC password fetching using Secret Service API is broken
Date: Sun, 10 May 2015 16:13:56 +0200
When trying to store ERC passwords using Secret Service API (i.e. when
using GNOME Keyring), ERC breaks when trying to join a channel.

Steps to reproduce:

⒈ Run emacs -Q.
⒉ Eval (require 'auth-source).
⒊ Eval (setq auth-sources '("secrets:FOO")), where FOO is an existing
keyring name.
⒋ Open ERC.
⒌ Try to connect to Freenode using the default settings.

What happens:
The following error is displayed:
auth-source-secrets-listify-pattern: Wrong type argument: sequencep, 6667

What should happen:
I should connect to Freenode.

One possible patch is attached below. This is the simplest solution; I
have not thought much about whether it may be more desirable to convert
numbers to strings inside the secrets.el package.

From 25f798b3b86a34bd6b262c59c3733d72eec50c13 Mon Sep 17 00:00:00 2001
From: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>
Date: Thu, 7 May 2015 13:01:24 +0200
Subject: [PATCH] * lisp/erc/erc.el (erc-open): Fix password fetching

ERC used to pass the port number as a number, however when using
Secret Service API, only strings can be used.

Copyright-paperwork-exempt: yes
---
 lisp/erc/erc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index cf422f1..a8f1478 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2010,7 +2010,8 @@ Returns the buffer for the given server or channel."
                            (auth-source-search :host server
                                                :max 1
                                                :user nick
-                                               :port port
+                                               ;; secrets.el wouldn’t accept a number
+                                               :port (if (numberp port) (number-to-string port) port)
                                                :require '(:secret)))
                       :secret)))
                 (if (functionp secret)
--
2.4.0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20541; Package emacs. (Mon, 01 Jun 2015 09:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 20541 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>
Cc: Ted Zlatanov <tzz <at> lifelogs.com>, 20541 <at> debbugs.gnu.org
Subject: Re: bug#20541: ERC password fetching using Secret Service API is
 broken
Date: Mon, 01 Jun 2015 11:20:58 +0200
Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com> writes:

> One possible patch is attached below. This is the simplest solution; I
> have not thought much about whether it may be more desirable to convert
> numbers to strings inside the secrets.el package.

Well, secrets.el expects only strings as attributes. No conversion
foreseen. I don't know what auth-source.el does. If auth-source-search
also allows only strings (and symbol names) as attributes, then your
patch is right. Otherwise, if a :port attribute could also be an
integer, it shall be transformed to a string.

Ted?

> From 25f798b3b86a34bd6b262c59c3733d72eec50c13 Mon Sep 17 00:00:00 2001
> From: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>
> Date: Thu, 7 May 2015 13:01:24 +0200
> Subject: [PATCH] * lisp/erc/erc.el (erc-open): Fix password fetching
>
> ERC used to pass the port number as a number, however when using
> Secret Service API, only strings can be used.
>
> Copyright-paperwork-exempt: yes
> ---
>  lisp/erc/erc.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
> index cf422f1..a8f1478 100644
> --- a/lisp/erc/erc.el
> +++ b/lisp/erc/erc.el
> @@ -2010,7 +2010,8 @@ Returns the buffer for the given server or channel."
>                             (auth-source-search :host server
>                                                 :max 1
>                                                 :user nick
> -                                               :port port
> +                                               ;; secrets.el wouldn’t accept a number
> +                                               :port (if (numberp port) (number-to-string port) port)
>                                                 :require '(:secret)))
>                        :secret)))
>                  (if (functionp secret)
> --
> 2.4.0

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20541; Package emacs. (Tue, 30 Jun 2015 02:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 20541 <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>, 20541 <at> debbugs.gnu.org
Subject: Re: bug#20541: ERC password fetching using Secret Service API is
 broken
Date: Mon, 29 Jun 2015 22:28:45 -0400
On Mon, 01 Jun 2015 11:20:58 +0200 Michael Albinus <michael.albinus <at> gmx.de> wrote: 

MA> Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com> writes:
>> One possible patch is attached below. This is the simplest solution; I
>> have not thought much about whether it may be more desirable to convert
>> numbers to strings inside the secrets.el package.

MA> Well, secrets.el expects only strings as attributes. No conversion
MA> foreseen. I don't know what auth-source.el does. If auth-source-search
MA> also allows only strings (and symbol names) as attributes, then your
MA> patch is right. Otherwise, if a :port attribute could also be an
MA> integer, it shall be transformed to a string.

Sorry for the late reply.

The docs of `auth-source-search' say:

    A string value is always matched literally.  A symbol is matched
    as its string value, literally.  All the SPEC values can be
    single values (symbol or string) or lists thereof (in which case
    any of the search terms matches).

...so numbers are not allowed. By design, that means that "80" and
"http" can be used for :port, for instance. IIRC there was no gain from
making any of the search criteria take numbers in the case of
auth-source.el specifically.

So I think the patch is OK :)

Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20541; Package emacs. (Sun, 27 Dec 2015 08:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 20541 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com>
Cc: 20541 <at> debbugs.gnu.org
Subject: Re: bug#20541: ERC password fetching using Secret Service API is
 broken
Date: Sun, 27 Dec 2015 09:05:02 +0100
Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com> writes:

>  lisp/erc/erc.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
> index cf422f1..a8f1478 100644
> --- a/lisp/erc/erc.el
> +++ b/lisp/erc/erc.el
> @@ -2010,7 +2010,8 @@ Returns the buffer for the given server or channel."
>                             (auth-source-search :host server
>                                                 :max 1
>                                                 :user nick
> -                                               :port port
> +                                               ;; secrets.el wouldn.t accept a number
> +                                               :port (if (numberp port) (number-to-string port) port)
>                                                 :require '(:secret)))
>                        :secret)))

Thanks; applied to Emacs 25.1.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 25.1, send any further explanations to 20541 <at> debbugs.gnu.org and Krzysztof Jurewicz <krzysztof.jurewicz <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 08:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 24 Jan 2016 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.