From unknown Sun Jul 27 06:47:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params Resent-From: Trevor Arjeski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Nov 2024 21:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74516 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 74516@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173248376117195 (code B ref -1); Sun, 24 Nov 2024 21:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 21:29:21 +0000 Received: from localhost ([127.0.0.1]:36313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFKAS-0004TH-9A for submit@debbugs.gnu.org; Sun, 24 Nov 2024 16:29:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:53924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFKAP-0004T6-3i for submit@debbugs.gnu.org; Sun, 24 Nov 2024 16:29:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFKAO-0005c6-R1 for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:29:16 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFKAL-0008FE-0d for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:29:15 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-53de582163fso18401e87.0 for ; Sun, 24 Nov 2024 13:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732483750; x=1733088550; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=AUQeqsmU1ew8b54wwGKmbfRbvbhvBX70xQ4gtyavY9U=; b=SLm5OfVwXWAjIaCtv8FPT6My1md6ub727IkKfDX+7iEHZ/n3W9KYvG9e7Ge23iop5i G7TTjNjWMdBcPONFlR78paqtyDbk3+gyNeiJKJHmqDHc2YU/lKxadudT62hzhn6DinCg nzHK50WPjyHxjvuxEAv1Lq9ZM2hEPFWCcsbwMB/vTrXKPbKyas/05MVrIcK8H+m4bUGn /bVno3OoLlCQDsVokt8ksxIKIlWw6z/geIc4IncVwGxpoIv46Rlv2c8kpZY894dLTjs0 z4RzGLvuLauJV3VKSDWdA8GXClQGJ4LEoOKbDKqJlJEkNu4pYA56Am9YHdxc+ZYV4U+o EnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732483750; x=1733088550; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AUQeqsmU1ew8b54wwGKmbfRbvbhvBX70xQ4gtyavY9U=; b=qfLY/fjKRiF3og0fkPVqq2t8Bb+d5Wv5HedtD8+toDc9/YXihsxcjhdDbZI83een1h FqowYsxZOW/RROOqbUS/k5aHR+Tqxa6b/kCdvdny5lPP5iZMqlZlGuImrtZm7m0uNHl4 SrPfccH7PEZiYnwy7Xf2lLHsQa+KexLfAe/ZyLJVPgCOfhIp/ueTZcW99Tvzfuqggie2 IiOsiK/mB5gn4QHu6RT62r4wXUiFlfsFBcMG/bKOlBT7m1SeVTVkU2O1g0RJ4b+fGQbX p0Z1nTuSE3zr/T+Wh0gTVhp/JdD7YEGJT7IDGGyWN9kL73YXLyhlSIMdAKtnAU00RWeg oj0A== X-Gm-Message-State: AOJu0YzS5B3bRUdJUj42eaI+aNX5VOk+qLNJAjDF8/bBIr3WVkd+kJdw GsJuI1d6XxDMNtnz5XUAQLF5QTcr0Sxu+0ae5fDsHBUH10Z6G7km4hwAdboa X-Gm-Gg: ASbGncuLjqlJcwtC1zqYPwsNd3PS65zpJ+CL8GB3/Y+3CQgRHIS+C/Eby0jTQw4udz2 6iJ2+KOBl6jnbpCTB46JTu03zpu759kU6ie9/ox2pFsalRRr42hwc0vZHqWOoNiTqTSEHCYX7Mn JoTPl79rHXYebEa9M5LqcZVMBdZcU4v04AFiMB6Frx+BjTx0oaYWtYVlJH5aIiJwDX7pL6IEcaY KnKEoYGUo84XHow9fvFI9Tb448OCj51MyRCfe5VL/hKZYitirzewbRhT7FcGZ2/PmbK9fkRO8Zh rQ== X-Google-Smtp-Source: AGHT+IEMuK3IwzK4iUN4v+k4FBLJXsttMlmcQzk/S0x7ACl00JxfOtB+21T6bKbIVq/d3AHZIDgKSQ== X-Received: by 2002:a05:6512:31cc:b0:53d:dd47:6d3 with SMTP id 2adb3069b0e04-53ddd4707bfmr2647582e87.7.1732483749917; Sun, 24 Nov 2024 13:29:09 -0800 (PST) Received: from trevarch (109-252-36-249.nat.spd-mgts.ru. [109.252.36.249]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd248b1bfsm1398446e87.205.2024.11.24.13.29.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 13:29:08 -0800 (PST) From: Trevor Arjeski Date: Mon, 25 Nov 2024 00:29:07 +0300 Message-ID: <87r070gw2k.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=tmarjeski@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-erc-allow-port-as-string-in-auth-source-params.patch Content-Description: erc-port-string-fix >From 9468a786fb8c0ef950117e78395592f2e11613c2 Mon Sep 17 00:00:00 2001 From: Trevor Arjeski Date: Sun, 24 Nov 2024 23:35:41 +0300 Subject: [PATCH] erc: allow port as string in auth-source params Checking the equality of the given `erc-session-port' with "irc" is unnecessary since: 1. "irc" is already added to the list of ports 2. /etc/services may contain "ircs-u" (or other) as the desired port If the correct port/service is missing then the auth-source query will fail for a seemingly unknown reason. This also allows a user to `(setopt erc-port "1234")', intentionally or accidentally, and still be able to use .authinfo for password management. --- lisp/erc/erc.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7028d0a68cc..81818a7227e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4675,8 +4675,7 @@ 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 erc-session-port) ; or nil (t erc-session-port)) "irc"))) (list (cons :host (delq nil hosts)) -- 2.47.0 --=-=-= Content-Type: text/plain Reproduction steps: 1. Have an entry in .authinfo, such as machine yourbouncer login nick password hunter2 port 7777 2. Using the following code in init.el, open emacs 3. M-x erc-connect 4. Notice ERC tries connecting without password 5. Change erc-port to be an integer (commented out below) 6. Retry steps 2 - 4 #+BEGIN_SRC emacs-lisp (use-package erc :ensure nil :preface (defun erc-connect () (interactive) (erc :server erc-server :port erc-port :user erc-nick)) :custom (erc-server "yourbouncer") (erc-port "7777") ;; (erc-port 7777) is working (erc-nick "nick")) #+END_SRC In GNU Emacs 31.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-11-14 built on trevarch Repository revision: b83a45eab53b8e6d8f3be45c0acb9a42a5262cb0 Repository branch: makepkg Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Arch Linux Configured using: 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-modules --without-m17n-flt --without-gconf --with-native-compilation=yes --with-xinput2 --with-x-toolkit=gtk3 --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm --without-compress-install '--program-transform-name=s/\([ec]tags\)/\1.emacs/' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wno-implicit-function-declaration -g -ffile-prefix-map=/home/trev/Workspace/emacs-git/src=/usr/src/debug/emacs-git -flto=auto' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LC_ALL: en_US.UTF-8 value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ERC Minor modes in effect: erc-track-mode: t erc-track-minor-mode: t erc-spelling-mode: t flyspell-mode: t erc-ring-mode: t erc-nicks-mode: t erc-netsplit-mode: t erc-menu-mode: t erc-match-mode: t erc-list-mode: t erc-irccontrols-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t erc-scrolltobottom-mode: t erc-imenu-mode: t erc-pcomplete-mode: t erc-button--phantom-users-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-autojoin-mode: t erc-networks-mode: t global-treesit-auto-mode: t corfu-popupinfo-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t savehist-mode: t vertico-mode: t undo-fu-session-global-mode: t undo-fu-session-mode: t which-key-mode: t electric-pair-mode: t global-auto-revert-mode: t desktop-save-mode: t recentf-mode: t save-place-mode: t override-global-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t window-divider-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: ~/.emacs.d//lisp/aoc hides /home/trev/.emacs.d/elpa/aoc-1.0.0/aoc ~/.emacs.d//lisp/launch-program hides /home/trev/.emacs.d/elpa/launch-program-1.0.0/launch-program ~/.emacs.d//lisp/my-secrets hides /home/trev/.emacs.d/elpa/my-secrets-1.0.0/my-secrets /home/trev/.emacs.d/elpa/transient-20241115.2034/transient hides /usr/share/emacs/31.0.50/lisp/transient Features: (shadow sort comp-run comp-common mail-extr emacsbug message yank-media dired dired-loaddefs rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums ace-window avy cape-char cape mule-util orderless network-stream puny nsm erc-track erc-spelling flyspell ispell erc-ring erc-nicks color erc-netsplit erc-menu erc-match erc-list erc-goodies erc-imenu imenu erc-pcomplete pcomplete erc-button erc-fill erc-stamp erc-join my-secrets cus-start epa-file epa derived epg rfc6068 epg-config erc format-spec erc-backend erc-networks erc-common erc-compat erc-loaddefs paredit display-line-numbers rx ligature rainbow-delimiters format-all language-id inheritenv init gnus nnheader gnus-util time-date mail-utils range mm-util mail-prsvr cus-edit pp treesit-auto treesit corfu-popupinfo corfu marginalia savehist vertico compat grep compile text-property-search comint ansi-osc ansi-color ring cus-load finder-inf undo-fu-session which-key diminish doom-themes-ext-org doom-nord-theme pcase doom-themes doom-themes-base edmacro kmacro elec-pair autorevert filenotify desktop frameset recentf tree-widget wid-edit saveplace use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source eieio eieio-core icons password-cache json subr-x map byte-opt url-vars cl-macs gv cl-extra help-mode cl-seq use-package-core cl-loaddefs cl-lib bytecomp byte-compile info ace-window-autoloads aoc-autoloads avy-autoloads cape-autoloads consult-autoloads corfu-autoloads debbugs-autoloads diff-hl-autoloads diminish-autoloads doom-themes-autoloads eat-autoloads elfeed-autoloads envrc-autoloads format-all-autoloads geiser-guile-autoloads geiser-autoloads git-modes-autoloads helpful-autoloads elisp-refs-autoloads f-autoloads inheritenv-autoloads language-id-autoloads launch-program-autoloads leetcode-autoloads aio-autoloads ligature-autoloads log4e-autoloads magit-autoloads magit-section-autoloads dash-autoloads marginalia-autoloads markdown-mode-autoloads my-secrets-autoloads nerd-icons-dired-autoloads nerd-icons-autoloads orderless-autoloads paredit-autoloads rainbow-delimiters-autoloads rainbow-mode-autoloads request-autoloads rust-mode-autoloads s-autoloads sly-autoloads transient-autoloads treesit-auto-autoloads undo-fu-autoloads undo-fu-session-autoloads vertico-autoloads with-editor-autoloads ws-butler-autoloads early-init rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 532575 259144) (symbols 48 21073 0) (strings 32 81801 33581) (string-bytes 1 2864363) (vectors 16 34038) (vector-slots 8 428812 185464) (floats 8 504 8884) (intervals 56 17700 11521) (buffers 992 19)) --=-=-=-- From unknown Sun Jul 27 06:47:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2024 03:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74516 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Trevor Arjeski Cc: 74516@debbugs.gnu.org, emacs-erc@gnu.org Received: via spool by 74516-submit@debbugs.gnu.org id=B74516.173259217129241 (code B ref 74516); Tue, 26 Nov 2024 03:37:02 +0000 Received: (at 74516) by debbugs.gnu.org; 26 Nov 2024 03:36:11 +0000 Received: from localhost ([127.0.0.1]:43744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFmN0-0007bV-6b for submit@debbugs.gnu.org; Mon, 25 Nov 2024 22:36:11 -0500 Received: from mail-108-mta191.mxroute.com ([136.175.108.191]:33101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFmMw-0007bH-Hk for 74516@debbugs.gnu.org; Mon, 25 Nov 2024 22:36:08 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta191.mxroute.com (ZoneMTA) with ESMTPSA id 193668a59890003e01.001 for <74516@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 26 Nov 2024 03:36:03 +0000 X-Zone-Loop: 54aabf4ae2fdc08879a4107ecf07534c75f07817d4af X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=939HqOnkLJMJjTif1Ed+PNjXyvLdVLTl9dVK/7hkoM8=; b=PDB7cQInuNkByZuayu1Z197hu1 i8Z7yk/MD3AHhVObMo4RM8IrOq3O2iIG7lcKcQwItwcYvV9dDDOLaUoAuGBlLXBbg3/ROBaGRHxvO RnZuvtYwq0yzJDRq/6R2TFFaI7VZRWmNutsEG60CMWl/ypYoEolVLnWuiTlBlfE3+kI6Lj/gdOPJa 3pLOp0HRrEowYWDtJccMt/hvv+BVbI7dikSlYP15j8jL+y9G9Xu/+SA/X+sybjuTTJu18CDQlr3sK 6+eu5LAj9GrQicyvAn/cr1NbQ8vx/UGzyM+tevHGOehg8Ly+pCe18efZgKX9qHFD5aHJDtq8Awtgd WptzIkCQ==; From: "J.P." In-Reply-To: <87r070gw2k.fsf@gmail.com> (Trevor Arjeski's message of "Mon, 25 Nov 2024 00:29:07 +0300") References: <87r070gw2k.fsf@gmail.com> Date: Mon, 25 Nov 2024 19:36:00 -0800 Message-ID: <87bjy2ekf3.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@neverwas.me X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Trevor Arjeski writes: > Reproduction steps: > > 1. Have an entry in .authinfo, such as > machine yourbouncer login nick password hunter2 port 7777 > > 2. Using the following code in init.el, open emacs > 3. M-x erc-connect > 4. Notice ERC tries connecting without password > 5. Change erc-port to be an integer (commented out below) > 6. Retry steps 2 - 4 > > [3. text/x-org] > #+BEGIN_SRC emacs-lisp > (use-package erc > :ensure nil > :preface > (defun erc-connect () > (interactive) > (erc :server erc-server > :port erc-port > :user erc-nick)) > :custom > (erc-server "yourbouncer") > (erc-port "7777") ;; (erc-port 7777) is working > (erc-nick "nick")) > #+END_SRC Thanks. I can reproduce this. > From 9468a786fb8c0ef950117e78395592f2e11613c2 Mon Sep 17 00:00:00 2001 > From: Trevor Arjeski > Date: Sun, 24 Nov 2024 23:35:41 +0300 > Subject: [PATCH] erc: allow port as string in auth-source params > > Checking the equality of the given `erc-session-port' with "irc" is > unnecessary since: > > 1. "irc" is already added to the list of ports > 2. /etc/services may contain "ircs-u" (or other) as the desired port I think it makes sense to allow entries to specify well known service names. And I suppose it couldn't hurt to also at least implicitly support numeric strings, although that sounds like bad UX if anyone should need to resort to that just to differentiate between entries. > If the correct port/service is missing then the auth-source query will > fail for a seemingly unknown reason. IIRC, all params appearing in an auth-source entry are basically required, and a successful query must therefore supply all of them. However, such a query may specify additional, unmatched or partially matched parameters. > This also allows a user to `(setopt erc-port "1234")', intentionally or > accidentally, and still be able to use .authinfo for password > management. > --- > lisp/erc/erc.el | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el > index 7028d0a68cc..81818a7227e 100644 > --- a/lisp/erc/erc.el > +++ b/lisp/erc/erc.el > @@ -4675,8 +4675,7 @@ 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 erc-session-port) ; or nil I've changed this slightly to become nil if `erc-session-port' is the empty string or "irc". > (t erc-session-port)) > "irc"))) > (list (cons :host (delq nil hosts)) I've also added a companion patch that changes some foundational behavior so that `erc-session-port' can more easily be set to a string to accommodate service names. With your example of machine mybouncer port ircs-u login mynick password hunter2 if someone tries to connect with (setopt auth-source-do-cache nil auth-source-debug t) (erc-tls :server "mybouncer" :nick "mynick") they should still be denied. But adding :port "ircs-u" to the invocation or doing something like (setopt erc-port "ircs-u") beforehand should see them succeed, assuming ircs-u appears in their /etc/services as a port listened on by their bouncer. Please try these out when you get a chance and give feedback if possible. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-5.6.1-Allow-querying-auth-source-with-port-as-string.patch >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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-5.6.1-Only-normalize-ports-for-equality-comparisons-.patch >From 420463c7f89a708ab0cc80e5bb2f6715fc48a03c Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 25 Nov 2024 04:21:36 -0800 Subject: [PATCH 2/2] [5.6.1] Only normalize ports for equality comparisons in ERC * etc/ERC-NEWS: Add entry explaining changes to entry point 'erc-tls' and library functions, like `erc-normalize-port' and `erc-compute-port'. * lisp/erc/erc.el (erc-normalize-port): Map "ircu" to 6665 instead of 6667. Add other IANA mappings. Return 0 for unknown nonempty strings. (erc-open): Pass `erc-session-port' through `erc-string-to-port' before handing it to `erc-server-connect'. This prevents the network-connection machinery from seeing a numeric string, like "6667". (erc-select-read-args): Use `erc-port-equal' instead of `eql'. (erc-tls): Respect a configured non-nil `erc-port' option when the user does not provide a :port argument. (erc-determine-parameters): Use `erc-compute-port' for `erc-session-port'. (erc-compute-port): Don't pass the result through `erc-normalize-port', which can convert it to an unintuitive form. (erc-handle-irc-url): Use `erc-port-equal' for comparison. (Bug#74516) * test/lisp/erc/erc-scenarios-auth-source.el (erc-scenarios-common--auth-source) (erc-scenarios-base-auth-source-server--dialed): Use `erc-port' option instead of passing a :port parameter to entry-point command. * test/lisp/erc/erc-tests.el (erc-normalize-port): New test. --- etc/ERC-NEWS | 25 +++++++++++ lisp/erc/erc.el | 52 +++++++++++++--------- test/lisp/erc/erc-scenarios-auth-source.el | 29 +++++++----- test/lisp/erc/erc-tests.el | 16 +++++++ 4 files changed, 88 insertions(+), 34 deletions(-) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 3970f67d725..1c7c278338f 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -62,6 +62,31 @@ of concerns and the newer module's "experimental" status, the migration was deemed worth any potential disruption, despite this being a point release. ERC appreciates your understanding in this matter. +** Entry-point command 'erc-tls' now considers option 'erc-port'. +When called in Lisp code, this command now respects a non-nil 'erc-port' +if the ':port' keyword is absent. This also means users with this +option set to a non-TLS port should make sure to specify a ':port' from +now on. + +** Changes in the library API. + +*** Function 'erc-normalize-port' may return 0 instead of nil. +When given a nonempty, non-numeric string, this function now returns 0. +ERC now officially requests that users not use its output for anything +but comparing port equality, which was always its intended purpose. + +*** Function 'erc-compute-port' no longer uses 'erc-normalize-port'. +An uninformed change in ERC 5.5 led to 'erc-compute-port' filtering its +result through 'erc-normalize-port', which brought unwelcome type +coercion and possible null return values. This defied its purpose of +ensuring a usable port. Users reliant on the aberrant 5.5 behavior +should wrap its return value in 'erc-normalize-port'. + +*** Local variable 'erc-session-port' may be a string. +Although this has always been the case, string values are now more +likely to be seen because ERC no longer coerces service names to port +numbers. + * Changes in ERC 5.6 diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 60d84b2b20c..46f096142d6 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1987,13 +1987,11 @@ erc-reuse-buffers "old behavior when t now permanent" "29.1") (defun erc-normalize-port (port) - "Normalize the port specification PORT to integer form. -PORT may be an integer, a string or a symbol. If it is a string or a -symbol, it may have these values: -* irc -> 194 -* ircs -> 994 -* ircd -> 6667 -* ircd-dalnet -> 7000" + "Normalize known PORT specifications to an integer. +Expect PORT to be an integer, a string, or a symbol to coerce into a +standardized form for the express purpose of equality comparisons. If +PORT is an IANA recognized service, return its numeric mapping. Do the +same for a few traditional but nonstandard names." ;; These were updated somewhat in 2022 to reflect modern standards ;; and practices. See also: ;; @@ -2001,7 +1999,7 @@ erc-normalize-port ;; https://www.iana.org/assignments/service-names-port-numbers (cond ((symbolp port) - (erc-normalize-port (symbol-name port))) + (and port (erc-normalize-port (symbol-name port)))) ((stringp port) (let ((port-nr (string-to-number port))) (cond @@ -2011,14 +2009,19 @@ erc-normalize-port 194) ((string-equal port "ircs") 994) - ((string-equal port "ircu") 6667) ; 6665-6669 + ((string-equal port "ircu") 6665) + ((string-equal port "ircu-2") 6666) + ((string-equal port "ircu-3") 6667) + ((string-equal port "ircu-4") 6668) + ((string-equal port "ircu-5") 6669) ((string-equal port "ircd") ; nonstandard (irc-serv is 529) 6667) ((string-equal port "ircs-u") 6697) ((string-equal port "ircd-dalnet") 7000) + ((string-empty-p port) nil) (t - nil)))) + 0)))) ((numberp port) port) (t @@ -2665,7 +2668,7 @@ erc-open (if connect (erc-server-connect erc-session-server - erc-session-port + (erc-string-to-port erc-session-port) buffer erc-session-client-certificate) (erc-update-mode-line)) @@ -2769,8 +2772,8 @@ erc-select-read-args (port (or (url-portspec url) (erc-compute-port (let ((d (erc-compute-port sp))) ; may be a string - (read-string (format-prompt "Port" d) - nil nil d))))) + (erc-string-to-port + (read-string (format-prompt "Port" d) nil nil d)))))) ;; Trust the user not to connect twice accidentally. We ;; can't use `erc-already-logged-in' to check for an existing ;; connection without modifying it to consider USER and PASS. @@ -2792,10 +2795,10 @@ erc-select-read-args (format-prompt "Server password" p) "Server password (optional): "))) (if erc-prompt-for-password (read-passwd m nil p) p))) - (opener (and (or sp (eql port erc-default-port-tls) + (opener (and (or sp (erc-port-equal port erc-default-port-tls) (and (equal server erc-default-server) (not (string-prefix-p "irc://" input)) - (eql port erc-default-port) + (erc-port-equal port erc-default-port) (y-or-n-p "Connect using TLS instead? ") (setq port erc-default-port-tls))) #'erc-open-tls-stream)) @@ -2891,7 +2894,8 @@ 'erc-ssl ;;;###autoload (cl-defun erc-tls (&key (server (erc-compute-server)) - (port (erc-compute-port 'ircs-u)) + (port (let ((erc-default-port erc-default-port-tls)) + (erc-compute-port))) (nick (erc-compute-nick)) (user (erc-compute-user)) password @@ -8841,7 +8845,7 @@ erc-determine-parameters - `erc-server-current-nick'" (setq erc-session-connector erc-server-connect-function erc-session-server (erc-compute-server server) - erc-session-port (or port erc-default-port) + erc-session-port (erc-compute-port port) erc-session-user-full-name (erc-compute-full-name name) erc-session-username (erc-compute-user user) erc-session-password (erc--compute-server-password passwd nick)) @@ -8914,8 +8918,12 @@ erc-compute-port - PORT (the argument passed to this function) - The `erc-port' option -- The `erc-default-port' variable" - (erc-normalize-port (or port erc-port erc-default-port))) +- The `erc-default-port' variable + +Note that between ERC 5.5 and 5.6.1, this function filtered its result +through `erc-normalize-port', which introduced regrettable surprises, +such as unwelcome, possibly null, type conversions." + (or (and port (not (equal "" port)) port) erc-port erc-default-port)) ;; time routines @@ -9909,9 +9917,9 @@ erc-handle-irc-url (and (string-equal erc-session-server host) ;; Ports only matter when dialed hosts ;; match and we have sufficient info. - (or (not port) - (= (erc-normalize-port erc-session-port) - port))))))))) + (or (null port) + (erc-port-equal erc-session-port + port))))))))) key deferred) (unless server-buffer (setq deferred t diff --git a/test/lisp/erc/erc-scenarios-auth-source.el b/test/lisp/erc/erc-scenarios-auth-source.el index f0a7a4cbaca..7e1e7c2f3ab 100644 --- a/test/lisp/erc/erc-scenarios-auth-source.el +++ b/test/lisp/erc/erc-scenarios-auth-source.el @@ -44,15 +44,19 @@ erc-scenarios-common--auth-source (string-join ents "\n"))) (auth-sources (list netrc-file)) (auth-source-do-cache nil) + (erc-port (and (eq erc-port 'test) (number-to-string port))) (erc-scenarios-common-extra-teardown (lambda () - (delete-file netrc-file)))) + (delete-file netrc-file))) + ;; With a `cl-defun', a keyword's presence prevents the default + ;; init form from being evaluated, even if its value is nil. + (args `( :server "127.0.0.1" + ,@(and (null erc-port) (list :port port)) + :nick "tester" + :full-name "tester" + :id ,id))) (ert-info ("Connect") - (with-current-buffer (erc :server "127.0.0.1" - :port port - :nick "tester" - :full-name "tester" - :id id) + (with-current-buffer (apply #'erc args) (should (string= (buffer-name) (if id (symbol-name id) (format "127.0.0.1:%d" port)))) @@ -60,12 +64,13 @@ erc-scenarios-common--auth-source (ert-deftest erc-scenarios-base-auth-source-server--dialed () :tags '(:expensive-test) - (erc-scenarios-common--auth-source - nil 'foonet - "machine GNU.chat port %d user tester password fake" - "machine FooNet port %d user tester password fake" - "machine 127.0.0.1 port %d user tester password changeme" - "machine 127.0.0.1 port %d user imposter password fake")) + (let ((erc-port 'test)) + (erc-scenarios-common--auth-source + nil 'foonet + "machine GNU.chat port %d user tester password fake" + "machine FooNet port %d user tester password fake" + "machine 127.0.0.1 port \"%s\" user tester password changeme" ; correct + "machine 127.0.0.1 port %d user imposter password fake"))) (ert-deftest erc-scenarios-base-auth-source-server--netid () :tags '(:expensive-test) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 4c5521721f0..c6936ba8dc0 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -2978,6 +2978,22 @@ erc--route-insertion (should-not (buffer-live-p spam-buffer)) (kill-buffer chan-buffer))) +(ert-deftest erc-normalize-port () + ;; The empty string, nil, and unsupported types become nil. + (should-not (erc-normalize-port "")) + (should-not (erc-normalize-port nil)) + (should-not (erc-normalize-port (current-buffer))) + + ;; Unrecognized names are coerced to 0. + (should (equal 0 (erc-normalize-port "fake"))) + + ;; Numbers pass through, but numeric strings are coerced. + (should (equal 6667 (erc-normalize-port 6667))) + (should (equal 6697 (erc-normalize-port "6697"))) + + ;; Strange IANA mappings recognized. + (should (equal 6665 (erc-normalize-port "ircu")))) + (defvar erc-tests--ipv6-examples '("1:2:3:4:5:6:7:8" "::ffff:10.0.0.1" "::ffff:1.2.3.4" "::ffff:0.0.0.0" -- 2.47.0 --=-=-=-- From unknown Sun Jul 27 06:47:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params Resent-From: Trevor Arjeski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2024 05:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74516 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "J.P." Cc: 74516@debbugs.gnu.org, emacs-erc@gnu.org Received: via spool by 74516-submit@debbugs.gnu.org id=B74516.173259927919380 (code B ref 74516); Tue, 26 Nov 2024 05:35:01 +0000 Received: (at 74516) by debbugs.gnu.org; 26 Nov 2024 05:34:39 +0000 Received: from localhost ([127.0.0.1]:44690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFoDf-00052V-BV for submit@debbugs.gnu.org; Tue, 26 Nov 2024 00:34:39 -0500 Received: from mail-lf1-f53.google.com ([209.85.167.53]:54340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFoDc-00052I-IX for 74516@debbugs.gnu.org; Tue, 26 Nov 2024 00:34:37 -0500 Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-53dde1bf977so2883534e87.0 for <74516@debbugs.gnu.org>; Mon, 25 Nov 2024 21:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732599215; x=1733204015; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=AYH3hMZm7UtF5qpjxK0EEN5URnPW08qODW8P35xz4yw=; b=Kao4JlDyN431RoqN3rOVKA1DFzpnijvB4NKIF8awqnzO631mOcdGnfADfI5IgXREDO LFExSlgIch4wQCU+q2+Ed/PWvCD5awS/NVbWSxV9AClBdeZo52uBlS7iwd9F4mxOBA8N PDevznARUf2j51egTr9BqEdn5RoYt60+hwief9Vdi19W7s+u+GZnkQ/RUwM3kH2bm9n4 6IjxjW43iHaxCpa9Xv0U8IA6e4OXNaThvOHmbtn2QUr39w5fiGi2LO31+1V8F7dYPYV2 TyfuvRHaSz22/n5LSV+BB8lCmHQBUUsfVwauYFsktMmCrQVePdDh1ENviXSXjAUCvPJH QQmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732599215; x=1733204015; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AYH3hMZm7UtF5qpjxK0EEN5URnPW08qODW8P35xz4yw=; b=FJ3ZI1tfSM7YIOfE8drnAoqquhUv/OcBYWvZk+WqWNZhlHWeRESj9v0FngJ1SP0PdJ q7MCrjDiuz0GpmDk7ldXvG2fZJ1kfP4l401BhZKmIjD/sRl+/isPOOaJ0gXzRIJE9hc1 VU59it41/EiSJAxH/8Jp5OIF13kDkQKti0n6MuuINtPWaHjhje/mlC/0+yAMPPTLtpIB UMTcXfVizWa+LNZ2dbsgOFlIxlHjjosPJb+vdd9lIQmQZev6cqH+wRn0fbu1zWeYg2oA 6TiNcest7dynOap1NgCMez9viVfawN6o//ML17vpcMJMALxtcbytn+FijvQvPsAyQZPg MAsQ== X-Gm-Message-State: AOJu0Yy7XqUPu+i9tB7X9YOfMHXKJ0qW5X7phqLWVz8+KtPOiuDwFcVT n6g92IDDfSRQnemP6PAJbF0SG41C6GErW5nX0ZN4qZhwP7D9iKxB X-Gm-Gg: ASbGncvaozmB0Djm8HJdPrxqJ0VbboFLKkJrT1e03dahfyn97SnnEUgg5+l5DGYQM0K PSiZc15fEXdIrgp0TOm7TGa4yrK46rsTRasxL+e/rDnL7BnfR7zXdi1woOK8LSw4YX3Xf/kokw7 Z0/eSlHcginzKDNK6f3k0jzIL+beQfstezDe7DBETq21dXhkohfz64XlGr1/KI4oLBfs6vwhe9I xG1AA1PaPZc2pRRtNKKd20/fNuKXw/TD61azmH8hAlHXyfD3SgxjJb3OzNrGOG8R43kk79kG+4+ 1g== X-Google-Smtp-Source: AGHT+IFM5LVh1PXLUih06VsuDcQEs1nMmFHb7xBsORlF1Su3kR1aRuQlceI5GCvevW69NTtOyCzbnA== X-Received: by 2002:a05:6512:3d26:b0:53d:ec9c:1198 with SMTP id 2adb3069b0e04-53dec9c11c1mr223822e87.6.1732599215062; Mon, 25 Nov 2024 21:33:35 -0800 (PST) Received: from trevarch (109-252-36-249.nat.spd-mgts.ru. [109.252.36.249]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd24519b6sm1910663e87.106.2024.11.25.21.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 21:33:33 -0800 (PST) From: Trevor Arjeski In-Reply-To: <87bjy2ekf3.fsf@neverwas.me> (J. P.'s message of "Mon, 25 Nov 2024 19:36:00 -0800") References: <87r070gw2k.fsf@gmail.com> <87bjy2ekf3.fsf@neverwas.me> Date: Tue, 26 Nov 2024 08:33:32 +0300 Message-ID: <87wmgqblub.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "J.P." writes: Great! LGTM. Thanks for taking the time and adding tests! Trevor From unknown Sun Jul 27 06:47:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Trevor Arjeski Subject: bug#74516: closed (Re: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params) Message-ID: References: <87zflebv4p.fsf@neverwas.me> <87r070gw2k.fsf@gmail.com> X-Gnu-PR-Message: they-closed 74516 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 74516@debbugs.gnu.org Date: Mon, 02 Dec 2024 03:52:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1733111522-15037-1" This is a multi-part message in MIME format... ------------=_1733111522-15037-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source= params which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 74516@debbugs.gnu.org. --=20 74516: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D74516 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1733111522-15037-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 74516-done) by debbugs.gnu.org; 2 Dec 2024 03:51:13 +0000 Received: from localhost ([127.0.0.1]:53781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHxSq-0003sM-TB for submit@debbugs.gnu.org; Sun, 01 Dec 2024 22:51:13 -0500 Received: from mail-108-mta168.mxroute.com ([136.175.108.168]:42763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHxSo-0003sB-38 for 74516-done@debbugs.gnu.org; Sun, 01 Dec 2024 22:51:11 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta168.mxroute.com (ZoneMTA) with ESMTPSA id 193857e44040003e01.001 for <74516-done@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Dec 2024 03:51:04 +0000 X-Zone-Loop: b8468cf080b9f33a6dd1c8b59820ee168589868dc86c X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=aSBZruFkqAQWy8SrSFCpYsxm/YBHyZ8tRUEWT9Xddo0=; b=ma4v+9AvcBl9L1a2seiUct9tZi UKYNcPKaDBVfiXrtwDuH4r4Domav7cSQUyL9lJZO4T90r1AA3/E6oJkcYjPFWU9Yqnf+/99awKqXq Cto6U/9BScl0Q3R+QafMlVEh8Zri/RJrZ1GXavk6X7iXIScSlKQH5Ou6D+JtXRG7j2JSS9Kb52R6M qhyg8LBauN4AzI4UY8ccgCN8yD2FOdkO4HWzcGUbzSo3RuO5zDRrZRRnhfEt0BGe/eYYFN/iYJ0Tk 2a5MnHFgVvIiA5cLQhROp03F6NgsP4s/3T/HK9QI8D869m/eRDstCFJgoZ/HHWoEGuk/2MhgX+6Vg jBFYo68Q==; From: "J.P." To: Trevor Arjeski Subject: Re: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params In-Reply-To: <87wmgqblub.fsf@gmail.com> (Trevor Arjeski's message of "Tue, 26 Nov 2024 08:33:32 +0300") References: <87r070gw2k.fsf@gmail.com> <87bjy2ekf3.fsf@neverwas.me> <87wmgqblub.fsf@gmail.com> Date: Sun, 01 Dec 2024 19:51:02 -0800 Message-ID: <87zflebv4p.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74516-done Cc: 74516-done@debbugs.gnu.org, emacs-erc@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Trevor Arjeski writes: > "J.P." writes: > > Great! LGTM. Thanks for taking the time and adding tests! > > Trevor Installed as https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d8995192 Thanks and closing. ------------=_1733111522-15037-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 21:29:21 +0000 Received: from localhost ([127.0.0.1]:36313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFKAS-0004TH-9A for submit@debbugs.gnu.org; Sun, 24 Nov 2024 16:29:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:53924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFKAP-0004T6-3i for submit@debbugs.gnu.org; Sun, 24 Nov 2024 16:29:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFKAO-0005c6-R1 for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:29:16 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFKAL-0008FE-0d for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:29:15 -0500 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-53de582163fso18401e87.0 for ; Sun, 24 Nov 2024 13:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732483750; x=1733088550; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=AUQeqsmU1ew8b54wwGKmbfRbvbhvBX70xQ4gtyavY9U=; b=SLm5OfVwXWAjIaCtv8FPT6My1md6ub727IkKfDX+7iEHZ/n3W9KYvG9e7Ge23iop5i G7TTjNjWMdBcPONFlR78paqtyDbk3+gyNeiJKJHmqDHc2YU/lKxadudT62hzhn6DinCg nzHK50WPjyHxjvuxEAv1Lq9ZM2hEPFWCcsbwMB/vTrXKPbKyas/05MVrIcK8H+m4bUGn /bVno3OoLlCQDsVokt8ksxIKIlWw6z/geIc4IncVwGxpoIv46Rlv2c8kpZY894dLTjs0 z4RzGLvuLauJV3VKSDWdA8GXClQGJ4LEoOKbDKqJlJEkNu4pYA56Am9YHdxc+ZYV4U+o EnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732483750; x=1733088550; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AUQeqsmU1ew8b54wwGKmbfRbvbhvBX70xQ4gtyavY9U=; b=qfLY/fjKRiF3og0fkPVqq2t8Bb+d5Wv5HedtD8+toDc9/YXihsxcjhdDbZI83een1h FqowYsxZOW/RROOqbUS/k5aHR+Tqxa6b/kCdvdny5lPP5iZMqlZlGuImrtZm7m0uNHl4 SrPfccH7PEZiYnwy7Xf2lLHsQa+KexLfAe/ZyLJVPgCOfhIp/ueTZcW99Tvzfuqggie2 IiOsiK/mB5gn4QHu6RT62r4wXUiFlfsFBcMG/bKOlBT7m1SeVTVkU2O1g0RJ4b+fGQbX p0Z1nTuSE3zr/T+Wh0gTVhp/JdD7YEGJT7IDGGyWN9kL73YXLyhlSIMdAKtnAU00RWeg oj0A== X-Gm-Message-State: AOJu0YzS5B3bRUdJUj42eaI+aNX5VOk+qLNJAjDF8/bBIr3WVkd+kJdw GsJuI1d6XxDMNtnz5XUAQLF5QTcr0Sxu+0ae5fDsHBUH10Z6G7km4hwAdboa X-Gm-Gg: ASbGncuLjqlJcwtC1zqYPwsNd3PS65zpJ+CL8GB3/Y+3CQgRHIS+C/Eby0jTQw4udz2 6iJ2+KOBl6jnbpCTB46JTu03zpu759kU6ie9/ox2pFsalRRr42hwc0vZHqWOoNiTqTSEHCYX7Mn JoTPl79rHXYebEa9M5LqcZVMBdZcU4v04AFiMB6Frx+BjTx0oaYWtYVlJH5aIiJwDX7pL6IEcaY KnKEoYGUo84XHow9fvFI9Tb448OCj51MyRCfe5VL/hKZYitirzewbRhT7FcGZ2/PmbK9fkRO8Zh rQ== X-Google-Smtp-Source: AGHT+IEMuK3IwzK4iUN4v+k4FBLJXsttMlmcQzk/S0x7ACl00JxfOtB+21T6bKbIVq/d3AHZIDgKSQ== X-Received: by 2002:a05:6512:31cc:b0:53d:dd47:6d3 with SMTP id 2adb3069b0e04-53ddd4707bfmr2647582e87.7.1732483749917; Sun, 24 Nov 2024 13:29:09 -0800 (PST) Received: from trevarch (109-252-36-249.nat.spd-mgts.ru. [109.252.36.249]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd248b1bfsm1398446e87.205.2024.11.24.13.29.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2024 13:29:08 -0800 (PST) From: Trevor Arjeski To: bug-gnu-emacs@gnu.org Subject: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params X-Debbugs-CC: emacs-erc@gnu.org X-Debbugs-Cc: Date: Mon, 25 Nov 2024 00:29:07 +0300 Message-ID: <87r070gw2k.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=tmarjeski@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-erc-allow-port-as-string-in-auth-source-params.patch Content-Description: erc-port-string-fix >From 9468a786fb8c0ef950117e78395592f2e11613c2 Mon Sep 17 00:00:00 2001 From: Trevor Arjeski Date: Sun, 24 Nov 2024 23:35:41 +0300 Subject: [PATCH] erc: allow port as string in auth-source params Checking the equality of the given `erc-session-port' with "irc" is unnecessary since: 1. "irc" is already added to the list of ports 2. /etc/services may contain "ircs-u" (or other) as the desired port If the correct port/service is missing then the auth-source query will fail for a seemingly unknown reason. This also allows a user to `(setopt erc-port "1234")', intentionally or accidentally, and still be able to use .authinfo for password management. --- lisp/erc/erc.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7028d0a68cc..81818a7227e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4675,8 +4675,7 @@ 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 erc-session-port) ; or nil (t erc-session-port)) "irc"))) (list (cons :host (delq nil hosts)) -- 2.47.0 --=-=-= Content-Type: text/plain Reproduction steps: 1. Have an entry in .authinfo, such as machine yourbouncer login nick password hunter2 port 7777 2. Using the following code in init.el, open emacs 3. M-x erc-connect 4. Notice ERC tries connecting without password 5. Change erc-port to be an integer (commented out below) 6. Retry steps 2 - 4 #+BEGIN_SRC emacs-lisp (use-package erc :ensure nil :preface (defun erc-connect () (interactive) (erc :server erc-server :port erc-port :user erc-nick)) :custom (erc-server "yourbouncer") (erc-port "7777") ;; (erc-port 7777) is working (erc-nick "nick")) #+END_SRC In GNU Emacs 31.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-11-14 built on trevarch Repository revision: b83a45eab53b8e6d8f3be45c0acb9a42a5262cb0 Repository branch: makepkg Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Arch Linux Configured using: 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-modules --without-m17n-flt --without-gconf --with-native-compilation=yes --with-xinput2 --with-x-toolkit=gtk3 --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm --without-compress-install '--program-transform-name=s/\([ec]tags\)/\1.emacs/' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wno-implicit-function-declaration -g -ffile-prefix-map=/home/trev/Workspace/emacs-git/src=/usr/src/debug/emacs-git -flto=auto' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LC_ALL: en_US.UTF-8 value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ERC Minor modes in effect: erc-track-mode: t erc-track-minor-mode: t erc-spelling-mode: t flyspell-mode: t erc-ring-mode: t erc-nicks-mode: t erc-netsplit-mode: t erc-menu-mode: t erc-match-mode: t erc-list-mode: t erc-irccontrols-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t erc-scrolltobottom-mode: t erc-imenu-mode: t erc-pcomplete-mode: t erc-button--phantom-users-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-autojoin-mode: t erc-networks-mode: t global-treesit-auto-mode: t corfu-popupinfo-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t savehist-mode: t vertico-mode: t undo-fu-session-global-mode: t undo-fu-session-mode: t which-key-mode: t electric-pair-mode: t global-auto-revert-mode: t desktop-save-mode: t recentf-mode: t save-place-mode: t override-global-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t window-divider-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: ~/.emacs.d//lisp/aoc hides /home/trev/.emacs.d/elpa/aoc-1.0.0/aoc ~/.emacs.d//lisp/launch-program hides /home/trev/.emacs.d/elpa/launch-program-1.0.0/launch-program ~/.emacs.d//lisp/my-secrets hides /home/trev/.emacs.d/elpa/my-secrets-1.0.0/my-secrets /home/trev/.emacs.d/elpa/transient-20241115.2034/transient hides /usr/share/emacs/31.0.50/lisp/transient Features: (shadow sort comp-run comp-common mail-extr emacsbug message yank-media dired dired-loaddefs rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums ace-window avy cape-char cape mule-util orderless network-stream puny nsm erc-track erc-spelling flyspell ispell erc-ring erc-nicks color erc-netsplit erc-menu erc-match erc-list erc-goodies erc-imenu imenu erc-pcomplete pcomplete erc-button erc-fill erc-stamp erc-join my-secrets cus-start epa-file epa derived epg rfc6068 epg-config erc format-spec erc-backend erc-networks erc-common erc-compat erc-loaddefs paredit display-line-numbers rx ligature rainbow-delimiters format-all language-id inheritenv init gnus nnheader gnus-util time-date mail-utils range mm-util mail-prsvr cus-edit pp treesit-auto treesit corfu-popupinfo corfu marginalia savehist vertico compat grep compile text-property-search comint ansi-osc ansi-color ring cus-load finder-inf undo-fu-session which-key diminish doom-themes-ext-org doom-nord-theme pcase doom-themes doom-themes-base edmacro kmacro elec-pair autorevert filenotify desktop frameset recentf tree-widget wid-edit saveplace use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source eieio eieio-core icons password-cache json subr-x map byte-opt url-vars cl-macs gv cl-extra help-mode cl-seq use-package-core cl-loaddefs cl-lib bytecomp byte-compile info ace-window-autoloads aoc-autoloads avy-autoloads cape-autoloads consult-autoloads corfu-autoloads debbugs-autoloads diff-hl-autoloads diminish-autoloads doom-themes-autoloads eat-autoloads elfeed-autoloads envrc-autoloads format-all-autoloads geiser-guile-autoloads geiser-autoloads git-modes-autoloads helpful-autoloads elisp-refs-autoloads f-autoloads inheritenv-autoloads language-id-autoloads launch-program-autoloads leetcode-autoloads aio-autoloads ligature-autoloads log4e-autoloads magit-autoloads magit-section-autoloads dash-autoloads marginalia-autoloads markdown-mode-autoloads my-secrets-autoloads nerd-icons-dired-autoloads nerd-icons-autoloads orderless-autoloads paredit-autoloads rainbow-delimiters-autoloads rainbow-mode-autoloads request-autoloads rust-mode-autoloads s-autoloads sly-autoloads transient-autoloads treesit-auto-autoloads undo-fu-autoloads undo-fu-session-autoloads vertico-autoloads with-editor-autoloads ws-butler-autoloads early-init rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 532575 259144) (symbols 48 21073 0) (strings 32 81801 33581) (string-bytes 1 2864363) (vectors 16 34038) (vector-slots 8 428812 185464) (floats 8 504 8884) (intervals 56 17700 11521) (buffers 992 19)) --=-=-=-- ------------=_1733111522-15037-1--