From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trevor Arjeski Newsgroups: gmane.emacs.bugs Subject: bug#74516: 31.0.50; ERC 5.6.1-git: [PATCH] allow port as string in auth-source params Date: Mon, 25 Nov 2024 00:29:07 +0300 Message-ID: <87r070gw2k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8814"; mail-complaints-to="usenet@ciao.gmane.io" To: 74516@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 24 22:30:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tFKBT-00025j-Du for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Nov 2024 22:30:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFKBC-0005gj-03; Sun, 24 Nov 2024 16:30:06 -0500 Original-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 1tFKB9-0005em-Kz for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:30:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFKB9-0008IG-8i for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:30:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=AUQeqsmU1ew8b54wwGKmbfRbvbhvBX70xQ4gtyavY9U=; b=Uo6tQ+Gym5tp59bFpuYl30/FRhaTwOq4zjUrswVRlIt4BMQIV2dMp/516XP0Xn9dzsh3AMY3KA3ozsTXJ6/6D2Ipv3BhZvVSdpV/Nylbh3O2DpdiyZUvh6ViTpxS7e443p0ymzr0f/8yMfeMSM7TVlXFTSccww6DoLLCNO1NRND03neiOqRy5JJiqFKeMYgmQSm8KCr4BSJ8q7gXLCfivpCK5syiO5PZhpEBxIBBjIJOYOjV5sVfNFY3N97jywlJmOf9w/mcZzWafj8OwsgLazrKf9TOh0nLCEnwRVQWFT5ZJm8iOK/fCvG7V/+2RuVd8gWHc9c9M3G2CYpQTLVGfA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFKB8-0004VA-Tv for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 16:30:02 -0500 X-Loop: help-debbugs@gnu.org 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 X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173248376117195 (code B ref -1); Sun, 24 Nov 2024 21:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 21:29:21 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295921 Archived-At: --=-=-= 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)) --=-=-=--