GNU bug report logs - #38371
27.0.50; network-stream-certificate fails to specify :port as a string for auth-source-search

Previous Next

Package: emacs;

Reported by: alex.murray <at> canonical.com

Date: Mon, 25 Nov 2019 21:33:41 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

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 38371 in the body.
You can then email your comments to 38371 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#38371; Package emacs. (Mon, 25 Nov 2019 21:33:41 GMT) Full text and rfc822 format available.

Acknowledgement sent to alex.murray <at> canonical.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Nov 2019 21:33:41 GMT) Full text and rfc822 format available.

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

From: Alex Murray <alex.murray <at> canonical.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; network-stream-certificate fails to specify :port as a
 string for auth-source-search
Date: Mon, 25 Nov 2019 22:20:02 +1030
[Message part 1 (text/plain, inline)]
Sending mail via SMTP in Emacs 27.0.50 fails when using the secrets
auth-source backend - this seems to be due to network-stream-certificate
calling auth-source-search with :port specified as an integer - since
then later auth-source-secrets-listify-pattern fails with the following
backtrace as it seems to expect all parameters to be strings.

Attached is a patch to resolve this, in the same way bug#20541 was
solved previously.

I wonder however if it might just be better to make
auth-source-secrets-listify-pattern smarter to handle numeric elements

Debugger entered--Lisp error: (wrong-type-argument sequencep 587)
  mapcar(#f(compiled-function (v) #<bytecode 0x157a1426228d>) 587)
  auth-source-secrets-listify-pattern((:port 587))
  auth-source-secrets-listify-pattern((:host "smtp.server.com" :port 587))
  auth-source-secrets-search(:backend #<auth-source-backend auth-source-backend-157a12d702d8> :type secrets :max 1 :require nil :create nil :delete nil :max 1 :host "smtp.server.com" :port 587)
  apply(auth-source-secrets-search :backend #<auth-source-backend auth-source-backend-157a12d702d8> :type secrets :max 1 :require nil :create nil :delete nil (:max 1 :host "smtp.server.com" :port 587))
  auth-source-search-backends((#<auth-source-backend auth-source-backend-157a12d40ef0> #<auth-source-backend auth-source-backend-157a12d702d8> #<auth-source-backend auth-source-backend-157a12d71808>) (:max 1 :host "smtp.server.com" :port 587) 1 nil nil nil)
  auth-source-search(:max 1 :host "smtp.server.com" :port 587)
  network-stream-certificate("smtp.server.com" 587 (:type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #<bytecode 0x157a140f6e29>) :client-certificate t :use-starttls-if-possible t))
  network-stream-open-starttls("smtpmail" #<buffer *trace of SMTP session to smtp.server.com*> "smtp.server.com" 587 (:type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #<bytecode 0x157a140f6e29>) :client-certificate t :use-starttls-if-possible t))
  open-network-stream("smtpmail" #<buffer *trace of SMTP session to smtp.server.com*> "smtp.server.com" 587 :type nil :return-list t :warn-unless-encrypted nil :capability-command "EHLO slate\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #<bytecode 0x157a140f6e29>) :client-certificate t :use-starttls-if-possible t)
  smtpmail-via-smtp(("foo <at> bar.com") #<buffer  smtpmail temp>)
  smtpmail-send-it()
  message-use-send-mail-function()
  message--default-send-mail-function()
  message-multi-smtp-send-mail()
  message--send-mail-maybe-partially()
  message-send-mail(nil)
  message-send-via-mail(nil)
  message-send(nil)
  message-send-and-exit(nil)
  funcall-interactively(message-send-and-exit nil)
  call-interactively(message-send-and-exit nil nil)
  command-execute(message-send-and-exit)

[0001-Fix-auth-source-password-lookup.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38371; Package emacs. (Tue, 26 Nov 2019 08:31:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Alex Murray <alex.murray <at> canonical.com>
Cc: 38371 <at> debbugs.gnu.org
Subject: Re: bug#38371: 27.0.50; network-stream-certificate fails to specify
 :port as a string for auth-source-search
Date: Tue, 26 Nov 2019 09:30:33 +0100
tags 38371 fixed
close 38371 27.1
quit

>>>>> On Mon, 25 Nov 2019 22:20:02 +1030, Alex Murray <alex.murray <at> canonical.com> said:

    Alex> Sending mail via SMTP in Emacs 27.0.50 fails when using the secrets
    Alex> auth-source backend - this seems to be due to network-stream-certificate
    Alex> calling auth-source-search with :port specified as an integer - since
    Alex> then later auth-source-secrets-listify-pattern fails with the following
    Alex> backtrace as it seems to expect all parameters to be strings.

    Alex> Attached is a patch to resolve this, in the same way bug#20541 was
    Alex> solved previously.

Thanks for the patch, pushed (with a slight modification, plus I added
the Bug# to the commit message).

    Alex> I wonder however if it might just be better to make
    Alex> auth-source-secrets-listify-pattern smarter to handle numeric elements

Maybe. But this is enough for now (and the recent flipping of the
default of network-stream-use-client-certificates would hide it
anyway).

Robert




Added tag(s) fixed. Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 26 Nov 2019 08:31:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 38371 <at> debbugs.gnu.org and alex.murray <at> canonical.com Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 26 Nov 2019 08:31:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38371; Package emacs. (Tue, 26 Nov 2019 10:44:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Alex Murray <alex.murray <at> canonical.com>, 38371 <at> debbugs.gnu.org
Subject: Re: bug#38371: 27.0.50; network-stream-certificate fails to specify
 :port as a string for auth-source-search
Date: Tue, 26 Nov 2019 11:43:40 +0100
Robert Pluim <rpluim <at> gmail.com> writes:

Hi,

>     Alex> I wonder however if it might just be better to make
>     Alex> auth-source-secrets-listify-pattern smarter to handle
>     Alex> numeric elements
>
> Maybe. But this is enough for now (and the recent flipping of the
> default of network-stream-use-client-certificates would hide it
> anyway).

Integer values for :port are not foreseen, see the docstring of
`auth-source-search':

--8<---------------cut here---------------start------------->8---
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).
--8<---------------cut here---------------end--------------->8---

> Robert

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38371; Package emacs. (Tue, 26 Nov 2019 10:55:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Alex Murray <alex.murray <at> canonical.com>, 38371 <at> debbugs.gnu.org
Subject: Re: bug#38371: 27.0.50; network-stream-certificate fails to specify
 :port as a string for auth-source-search
Date: Tue, 26 Nov 2019 11:54:20 +0100
>>>>> On Tue, 26 Nov 2019 11:43:40 +0100, Michael Albinus <michael.albinus <at> gmx.de> said:

    Michael> Integer values for :port are not foreseen, see the docstring of
    Michael> `auth-source-search':

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

Right, which is why Alex's patch was the right thing to do.

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38371; Package emacs. (Tue, 26 Nov 2019 15:16:01 GMT) Full text and rfc822 format available.

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

From: Alex Murray <alex.murray <at> canonical.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 38371 <at> debbugs.gnu.org
Subject: Re: bug#38371: 27.0.50; network-stream-certificate fails to specify
 :port as a string for auth-source-search
Date: Tue, 26 Nov 2019 21:34:49 +1030
On Tue, 2019-11-26 at 19:00:33 +1030, Robert Pluim wrote:

>
> Thanks for the patch, pushed (with a slight modification, plus I added
> the Bug# to the commit message).

Thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Dec 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 234 days ago.

Previous Next


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