From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Murray Newsgroups: gmane.emacs.bugs Subject: bug#38371: 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-ID: <87sgmcgoph.fsf@canonical.com> Reply-To: alex.murray@canonical.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="163748"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.2.0; emacs 27.0.50 To: 38371@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 25 22:38:30 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iZM3x-000gQ6-Ue for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2019 22:38:30 +0100 Original-Received: from localhost ([::1]:48450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZM3w-00031t-Oo for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2019 16:38:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59777) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZLzM-0006a1-7u for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:33:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZLzJ-0003Z5-PW for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:33:43 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43805) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZLzJ-0003Yx-Lf for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:33:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iZLzJ-0002Wk-Ic for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:33:41 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Murray Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2019 21:33:41 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38371 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15746955145042 (code B ref -1); Mon, 25 Nov 2019 21:33:41 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2019 15:25:14 +0000 Original-Received: from localhost ([127.0.0.1]:49515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZGEj-0001JG-SI for submit@debbugs.gnu.org; Mon, 25 Nov 2019 10:25:14 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZDqJ-0005JQ-K7 for submit@debbugs.gnu.org; Mon, 25 Nov 2019 07:51:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54098) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZCsd-0005Go-FJ for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 06:50:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZCsc-0007ga-0X for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 06:50:11 -0500 Original-Received: from youngberry.canonical.com ([91.189.89.112]:34026) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZCsb-0007f7-PP for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 06:50:09 -0500 Original-Received: from 1.general.amurray.us.vpn ([10.172.65.220] helo=slate) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iZCsY-0001lA-S5 for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 11:50:07 +0000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Mailman-Approved-At: Mon, 25 Nov 2019 10:25:12 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172391 Archived-At: --=-=-= Content-Type: text/plain 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) #) 587) auth-source-secrets-listify-pattern((:port 587)) auth-source-secrets-listify-pattern((:host "smtp.server.com" :port 587)) auth-source-secrets-search(:backend # :type secrets :max 1 :require nil :create nil :delete nil :max 1 :host "smtp.server.com" :port 587) apply(auth-source-secrets-search :backend # :type secrets :max 1 :require nil :create nil :delete nil (:max 1 :host "smtp.server.com" :port 587)) auth-source-search-backends((# # #) (: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) #) :client-certificate t :use-starttls-if-possible t)) network-stream-open-starttls("smtpmail" # "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) #) :client-certificate t :use-starttls-if-possible t)) open-network-stream("smtpmail" # "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) #) :client-certificate t :use-starttls-if-possible t) smtpmail-via-smtp(("foo@bar.com") #) 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) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-auth-source-password-lookup.patch >From 92942fc012b96240c908834add932f4a551ab883 Mon Sep 17 00:00:00 2001 From: Alex Murray Date: Mon, 25 Nov 2019 22:18:07 +1030 Subject: [PATCH] Fix auth-source password lookup * lisp/net/network-stream.el (network-stream-certificate): Ensure :port is specified as a string to 'auth-source-search'. Copyright-paperwork-exempt: yes --- lisp/net/network-stream.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 9a796d93ab..3227458f8a 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -228,7 +228,9 @@ gnutls-boot (as returned by `gnutls-boot-parameters')." (let* ((auth-info (car (auth-source-search :max 1 :host host - :port service))) + :port (if (numberp service) + (number-to-string service) + service)))) (key (plist-get auth-info :key)) (cert (plist-get auth-info :cert))) (and key cert (file-readable-p key) (file-readable-p cert) -- 2.20.1 --=-=-=--