]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow querying auth-source with port as string in ERC
authorTrevor Arjeski <tmarjeski@gmail.com>
Sun, 24 Nov 2024 20:35:41 +0000 (23:35 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Dec 2024 17:02:19 +0000 (18:02 +0100)
* 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
(cherry picked from commit d899519221b23a895672a100f63410ffb8b8b1e4)

lisp/erc/erc.el

index bd2cf57d5e9e85ad6a852201b01bd7399045a975..5afa8c875b12a8e1bbc6694c040ff236ddd845d8 100644 (file)
@@ -4674,8 +4674,9 @@ node `(erc) auth-source'."
                   (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))