Subject: Re: bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 05 Sep 2021 10:40:06 +0200

Michael Albinus <[email-masked]> writes:

> Perhaps setting auth-source-debug gives more information?

Unfortunately not.  This is the most confusing behaviour I've ever seen
in Emacs -- it does prompt if I edebug certain auth-source functions,
so I added a bunch of messages to see where it...  gives out.  And:

(defun auth-source-netrc-saver (file add)

[...]

        ;; Ask AFTER we've successfully opened the file.
        (let ((prompt (format "Save auth info to file %s? " file))
              (done (not (eq auth-source-save-behavior 'ask)))
              (bufname "*auth-source Help*")
              k)
          (message "hello 3 %s %s" auth-source-save-behavior done)
          (while (not done)
            (message "hello 3.5")
            (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
            (message "hello 4 %s" k)

Tramp: Opening connection nil for larsi@stories using ssh...
hello 2 nil
hello 3 ~/.authinfo
hello 3 ask nil
hello 3.5
Tramp: Opening connection nil for larsi@stories using ssh...done

So we're getting all the way to `auth-source-read-char-choice' (which
just does a read-char-choice), but not to the next statement.

Is something making read-char-choice bug out, but in a way that's caught
by Tramp (or something else), so we just continue?  debug-on-signal
doesn't help, either.

Very confusing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no