From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Certner Newsgroups: gmane.emacs.bugs Subject: bug#45340: erc-services.el: Auth-source support for passwords Date: Fri, 15 Jan 2021 13:41:23 +0100 Message-ID: <1936038.bl7DLxgNLY@ravel> References: <87v9cw7np1.fsf@sol.hw.lgcl.de> <4311421.VgBTkc7HA1@ravel> <87mtxalals.fsf@sol.hw.lgcl.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13577"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, bandali@gnu.org To: dev@lgcl.de, 45340@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 15 13:42:11 2021 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 1l0OQd-0003Rj-92 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jan 2021 13:42:11 +0100 Original-Received: from localhost ([::1]:53288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0OQc-0001Xc-4G for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jan 2021 07:42:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0OQU-0001XQ-1e for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 07:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0OQT-0002wi-QK for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 07:42:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0OQT-0000JM-Mr for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 07:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Olivier Certner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jan 2021 12:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed X-Debbugs-Original-To: Leon Vack , bug-gnu-emacs@gnu.org X-Debbugs-Original-Cc: Lars Ingebrigtsen , 45340@debbugs.gnu.org, Amin Bandali Original-Received: via spool by submit@debbugs.gnu.org id=B.16107145001169 (code B ref -1); Fri, 15 Jan 2021 12:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jan 2021 12:41:40 +0000 Original-Received: from localhost ([127.0.0.1]:40106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0OQ8-0000In-1W for submit@debbugs.gnu.org; Fri, 15 Jan 2021 07:41:40 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0OQ5-0000If-OD for submit@debbugs.gnu.org; Fri, 15 Jan 2021 07:41:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0OQ5-0001VS-Ci for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 07:41:37 -0500 Original-Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]:57642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0OQ3-0002l6-CI; Fri, 15 Jan 2021 07:41:37 -0500 Original-Received: from ravel.localnet (unknown [90.116.215.75]) (Authenticated sender: ocert.dev@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id A202F780372; Fri, 15 Jan 2021 13:41:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1610714493; bh=fknxt5t8dtkLOlSWwSZYMGTUmrXq3vuWP2YK4TnYwWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gfA/lpKfxASeKBVuhP4tGCc0xJHaW4s/28p/wRSOlQHvHH3gbydEubUt2xbC40hgq RseeFfCsGo+aR2w4LYqlhdpaq5Xu9l5y4Usc8kq7eIhSDO7DZDx1QhMB5WNT+XbNOX KLWknz/pUIeF4bipcQMCksKbAkj7BfchsPUfwSC/9gxw1P9QcPKFUlqftO+kORV5NA BZMUu/FSXHNOcJSXw4rEC+OFxN6pfP5Tt8+3I/+Ea+hJJdRBWt2tZaEvrsKGGIcYXn kKesXu9igkqUNYfRCHsUtdwl94K1c1YT0FOLdpdvIemCoTAaZmJZrive+Nv5ptmhm/ D2cyiQIdlYm6g== In-Reply-To: <87mtxalals.fsf@sol.hw.lgcl.de> Received-SPF: none client-ip=2a01:e0c:1:1599::15; envelope-from=ocert.dev@free.fr; helo=smtp6-g21.free.fr 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_NONE=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" Xref: news.gmane.io gmane.emacs.bugs:197985 Archived-At: Hi Leon, > I was not aware of this, but I have done some debugging and the NickServ > authentication you use mostly likely does not go through erc-services, > but the core erc functionality to connect, which sends a PASS command > with a password from auth source. At least freenode accepts this as a way > to do NickServ authentication and the patch does not effect this > functionality at all. To check if that is indeed the case, maybe try > connecting without having the erc-services module loaded. Yes, seems to me that you are right, after activating IRC protocol debug (`erc-toggle-debug-irc-protocol'), reconnecting to Freenode and looking at the logs. > This patch introduces a different functionality as described above, as > erc-services, which only handles authentication with actual /nickserv > identify commands (not handled by the core connect functionality), did > not query auth source before this patch. Fine, I thought this may have been already implemented somehow because of Freenode's special behavior. Thanks for looking at this, and for this patch! After reviewing the code more in details, I think it is great that `erc- nickserv-get-password' first tries to find a password in `erc-nickserv- passwords' before proceeding with auth source. `erc-nickserv-passwords' is the easiest to customize, and I suspect it is mostly used for interactive override or common presets in the init file. I also have some further suggestion, beyond this enhancement. I think it would be even more useful that `erc-prompt-for-nickserv-password' is not required to be nil for auth source (or `erc-nickserv-passwords', for that purpose) to be used, but rather that, if search in `erc-nickserv-passwords' and auth source (if enabled) fails, then prompting should be used as a last resort (if enabled). I think this would cover all the use cases I can think of (with proper settings of `erc-prompt-for-nickserv-password' and `erc-use-auth- source-for-nickserv-password'). If more customizations are required, or just for the sake of 'simplicity' (YMMV), than maybe replacing these booleans with a single list indicating the means to get the password and their order could be nice. What do people think? Regards. -- Olivier Certner