>From 0b82f7665c81008a0a3683c459c492f454c1a2af Mon Sep 17 00:00:00 2001 From: Trevor Arjeski Date: Sun, 24 Nov 2024 23:35:41 +0300 Subject: [PATCH 1/2] [5.6.1] Allow querying auth-source with port as string in ERC * lisp/erc/erc.el (erc--auth-source-determine-params-defaults): Allow arbitrary strings for `ers-session-port'. Previously, if a port/service was any string other than "irc", the auth-source query would fail for a seemingly unknown reason. Restricting the value to "irc" is unnecessary since "irc" is already added to the list of ports, and `make-network-process' already consults /etc/services for well-known service names, like "ircs-u", etc. This change allows a user to (setopt erc-port "1234"), intentionally or accidentally, while still being able to use .authinfo for password management. (Bug#74516) Copyright-paperwork-exempt: yes --- lisp/erc/erc.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7028d0a68cc..60d84b2b20c 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4675,8 +4675,9 @@ erc--auth-source-determine-params-defaults (list net erc-server-announced-name erc-session-server))) (ports (list (cl-typecase erc-session-port (integer (number-to-string erc-session-port)) - (string (and (string= erc-session-port "irc") - erc-session-port)) ; or nil + (string (and (not (member erc-session-port + '("" "irc"))) + erc-session-port)) (t erc-session-port)) "irc"))) (list (cons :host (delq nil hosts)) -- 2.47.0