From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: master ad5cf84fa7: Add `auth-info-password' and use it instead of ad hoc code Date: Sun, 09 Jan 2022 17:51:24 -0500 Organization: disorganization Message-ID: <87r19g34lv.fsf@gnu.org> References: <164158514200.7829.12726312320214416447@vcs2.savannah.gnu.org> <20220107195223.57DA2C0DA1B@vcs2.savannah.gnu.org> <875yqu8xr8.fsf@gmx.de> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32919"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:x8n6DtfOpKAJN/w8UibJ9i7ivTQ= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 09 23:52:26 2022 Return-path: Envelope-to: ged-emacs-devel@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 1n6h34-0008QJ-2b for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Jan 2022 23:52:26 +0100 Original-Received: from localhost ([::1]:44544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6h33-0005ZS-4D for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Jan 2022 17:52:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6h2M-0004s3-Ck for emacs-devel@gnu.org; Sun, 09 Jan 2022 17:51:42 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:45024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6h2G-0002Nt-1k for emacs-devel@gnu.org; Sun, 09 Jan 2022 17:51:41 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1n6h2D-0007FH-0A for emacs-devel@gnu.org; Sun, 09 Jan 2022 23:51:33 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284510 Archived-At: Hi Michael, > * Michael Albinus [2022-01-08 08:58:19 +0100]: > Sam Steingold writes: > >> Add `auth-info-password' and use it instead of ad hoc code > > Thanks for this! Would you mind to add also a description of this > function to auth.texi, for the benefit of other package authors? As > bonus, also a test in auth-source-tests.el? Sure, will do. >> +(defun auth-info-password (auth-info) >> + "Return the :secret password from the AUTH-INFO." >> + (let ((secret (plist-get auth-info :secret))) >> (if (functionp secret) >> (funcall secret) >> secret))) > > > Tramp ought to use a different implementation: > >> - (while (functionp auth-passwd) >> - (setq auth-passwd (funcall auth-passwd))) > > > I have no reference for the problem which has triggered this, all I've > found is this ChangeLog entry: > > 2018-05-02 Michael Albinus > > * tramp.el: ... > (tramp-read-passwd): auth-source could return cascaded functions. > > Perhaps it is better to use the loop as well in auth-info-password? Tramp is the only package that assumes "cascaded functions". Are you sure `auth-source' _can_ return them? Thank you. -- Sam Steingold (http://sds.podval.org/) on Pop 21.10 (impish) X 11.0.12013000 http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com https://www.memritv.org https://ij.org/ https://iris.org.il Brainwashing leads to brain drain.