[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master ad5cf84fa7: Add `auth-info-password' and use it instead of ad
From: |
Michael Albinus |
Subject: |
Re: master ad5cf84fa7: Add `auth-info-password' and use it instead of ad hoc code |
Date: |
Sat, 08 Jan 2022 08:58:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Sam Steingold <sds@gnu.org> writes:
Hi Sam,
> 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?
Whether this is good for an etc/NEWS entry I don't know, but likely yes.
--8<---------------cut here---------------start------------->8---
> +(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)))
--8<---------------cut here---------------end--------------->8---
Tramp ought to use a different implementation:
--8<---------------cut here---------------start------------->8---
> - (while (functionp auth-passwd)
> - (setq auth-passwd (funcall auth-passwd)))
--8<---------------cut here---------------end--------------->8---
I have no reference for the problem which has triggered this, all I've
found is this ChangeLog entry:
--8<---------------cut here---------------start------------->8---
2018-05-02 Michael Albinus <michael.albinus@gmx.de>
* tramp.el: ...
(tramp-read-passwd): auth-source could return cascaded functions.
--8<---------------cut here---------------end--------------->8---
Perhaps it is better to use the loop as well in auth-info-password?
Best regards, Michael.
- Re: master ad5cf84fa7: Add `auth-info-password' and use it instead of ad hoc code,
Michael Albinus <=