Subject: bug#39489: 28.0.50; On Emacs 27, 28, tramp hangs indefinitely

From: Michael Albinus <[email-masked]>
Date: Mon, 10 Feb 2020 10:11:24 +0100

Benjamin Slade <[email-masked]> writes:

> Hi Michael,

Hi Benjamin,

>> I don't know why `auth-source-search' needs to expand ".". Could it
>> be, that it is part of your `exec-path'?
>
> It turns out my $PATH variable had an 'empty' field
> (e.g. =/usr/local/bin::/home/slade/.guix-profile/bin=),
> eliminating that fixed the tramp issue I described in the bug
> report. (it's interesting that this only manifested was 27+)

An empty entry in $PATH is taken as `default-directory', implemented as
"." in `exec-path'. And this is a problem, if `call-process' searches
for the gpg command, and `default-directory' is remote. I have no idea
why this problem has uncovered in Emacs 27 only, though.

You have fixed it yourself I guess. But since it happens also for other
people, could you pls check whether the appended patch would have
solved it for you, keeping the empty field in your $PATH?

> [There is still an issue with the =em-tramp= package on Emacs 27+,
> which causes a complete lock-up (i.e. C-g won't work), but that
> should likely be a separate bug report.]

Please do.

> best wishes,
>   —Ben

Best regards, Michael.

diff --git a/lisp/tramp.el b/lisp/tramp.el
index 7e68b639..4c057703 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -4868,7 +4868,8 @@ verbosity of 6."
   "Read a password from user (compat function).
 Consults the auth-source package.
 Invokes `password-read' if available, `read-passwd' else."
-  (let* ((case-fold-search t)
+  (let* ((default-directory (tramp-compat-temporary-file-directory))
+	 (case-fold-search t)
 	 (key (tramp-make-tramp-file-name
 	       ;; In tramp-sh.el, we must use "password-vector" due to
 	       ;; multi-hop.