Subject: bug#35241: 27.0.50; Tramp can't decrypt .authinfo.gpg in Win 10

From: Shuguang Sun <[email-masked]>
Date: Tue, 16 Apr 2019 17:42:05 +0800

Michael Albinus <[email-masked]> writes:

> Shuguang Sun <[email-masked]> writes:
>
> Hi,
>
>> Below is part of the message. It seems it try to find "gpg2", and
>> there is no "gpg2".
>
> Yes.
>
>>   tramp-file-name-handler(expand-file-name "." "/plink:[email-masked]:")
>>   locate-file-internal("gpg2" (list of path) (".exe" ".com" ".bat" ".cmd" ".btm" "") 1)
>>   executable-find("gpg2")
>
> This is the crucial part. `executable-find' shall operate on the local
> file system only. But it calls `locate-file-internal' with a PATH
> pointing to remote.
>
> I suppose you have edited the backtrace, and written (list of path).
> What is there? My crystal ball tells me it contains "." ...
>
> Best regards, Michael.
>
>

Here is the full trace. I'm sorry for my mistake in previous messages.

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (quit)
  tramp-accept-process-output(#<process *tramp/plink [email-masked]*>)
  tramp-wait-for-regexp(#<process *tramp/plink [email-masked]*> nil "\\(^\\|\0\\)[^#$\n]*///61c1f45b2851d8909126eda541bf6308...")
  tramp-wait-for-output(#<process *tramp/plink [email-masked]*>)
  tramp-send-command((tramp-file-name "plink" "username" nil "host.com" nil "./." nil) "cd ~ && pwd")
  tramp-sh-handle-expand-file-name("." "/plink:[email-masked]:")
  apply(tramp-sh-handle-expand-file-name ("." "/plink:[email-masked]:"))
  tramp-sh-file-name-handler(expand-file-name "." "/plink:[email-masked]:")
  apply(tramp-sh-file-name-handler expand-file-name ("." "/plink:[email-masked]:"))
  tramp-file-name-handler(expand-file-name "." "/plink:[email-masked]:")
  locate-file-internal("gpg2" ("." "C:/Users/username/emacs/bin/" "C:/Users/username/scoop/apps/r-openblas/current/bin/..." "C:/Users/username/scoop/apps/gnupg/current/bin/" "C:/Users/username/scoop/shims/" "C:/Users/username/Progs/winports/bin/" "c:/Users/username/AppData/Roaming/Python/Python37/Sc..." "C:/Users/username/Progs/Python37" "C:/Users/username/Progs/Python37/Scripts" "C:/Users/username/Progs/Python37/DLLS" "C:/Users/username/Progs/msys64/mingw64/bin/" "C:/Users/username/Progs/msys64/usr/bin/" "C:/Users/username/Progs/svn-win32/bin/" "C:/Users/username/Progs/mplayer-console/" "C:/Users/username/Progs/LanguageTool/" "c:/Program Files (x86)/Google/Chrome/Application/" "C:/Users/username/Progs/miktex-portable/texmfs/insta..." "C:/Users/username/scoop/apps/nodejs/current/bin/" "C:/Users/username/scoop/apps/nodejs/current/" "C:/Users/username/Progs/winports/emax/mingw64/bin" "c:/app/oracle/client11g/product/11.2.0/client/bin" "C:/Program Files (x86)/Java/jre6/bin" "C:/Program Files/Java/jre6/bin" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/Program Files/SAS 94TS1M1/Secure/ccme4" "C:/Program Files/SAS 94TS1M1/x86/Secure/ccme4" "C:/Users/username/scoop/apps/gnupg/current/bin" "C:/Users/username/scoop/shims" "C:/Users/username/AppData/Local/Microsoft/WindowsApp..." "c:/Users/username/emacs/libexec/emacs/27.0.50/x86_64...") (".exe" ".com" ".bat" ".cmd" ".btm" "") 1)
  locate-file("gpg2" ("." "C:/Users/username/emacs/bin/" "C:/Users/username/scoop/apps/r-openblas/current/bin/..." "C:/Users/username/scoop/apps/gnupg/current/bin/" "C:/Users/username/scoop/shims/" "C:/Users/username/Progs/winports/bin/" "c:/Users/username/AppData/Roaming/Python/Python37/Sc..." "C:/Users/username/Progs/Python37" "C:/Users/username/Progs/Python37/Scripts" "C:/Users/username/Progs/Python37/DLLS" "C:/Users/username/Progs/msys64/mingw64/bin/" "C:/Users/username/Progs/msys64/usr/bin/" "C:/Users/username/Progs/svn-win32/bin/" "C:/Users/username/Progs/mplayer-console/" "C:/Users/username/Progs/LanguageTool/" "c:/Program Files (x86)/Google/Chrome/Application/" "C:/Users/username/Progs/miktex-portable/texmfs/insta..." "C:/Users/username/scoop/apps/nodejs/current/bin/" "C:/Users/username/scoop/apps/nodejs/current/" "C:/Users/username/Progs/winports/emax/mingw64/bin" "c:/app/oracle/client11g/product/11.2.0/client/bin" "C:/Program Files (x86)/Java/jre6/bin" "C:/Program Files/Java/jre6/bin" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/Program Files/SAS 94TS1M1/Secure/ccme4" "C:/Program Files/SAS 94TS1M1/x86/Secure/ccme4" "C:/Users/username/scoop/apps/gnupg/current/bin" "C:/Users/username/scoop/shims" "C:/Users/username/AppData/Local/Microsoft/WindowsApp..." "c:/Users/username/emacs/libexec/emacs/27.0.50/x86_64...") (".exe" ".com" ".bat" ".cmd" ".btm" "") 1)
  executable-find("gpg2")
  epg-find-configuration(OpenPGP)
  epg-context--make(OpenPGP nil nil nil nil nil nil)
  epg-make-context()
  epa-file-insert-file-contents("c:/Users/username/HOME/.authinfo.gpg" nil nil nil nil)
  apply(epa-file-insert-file-contents ("c:/Users/username/HOME/.authinfo.gpg" nil nil nil nil))
  epa-file-handler(insert-file-contents "c:/Users/username/HOME/.authinfo.gpg" nil nil nil nil)
  insert-file-contents("~/.authinfo.gpg")
  auth-source-netrc-parse(:max 1 :require (:secret :user) :file "~/.authinfo.gpg" :host "host.com" :user "username" :port "plink")
  auth-source-netrc-search(:backend #<auth-source-backend auth-source-backend-3160aac> :type netrc :max 1 :require (:secret :user) :create nil :delete nil :max 1 :user "username" :host "host.com" :port "plink" :require (:secret :user) :create t)
  apply(auth-source-netrc-search :backend #<auth-source-backend auth-source-backend-3160aac> :type netrc :max 1 :require (:secret :user) :create nil :delete nil (:max 1 :user "username" :host "host.com" :port "plink" :require (:secret :user) :create t))
  auth-source-search-backends((#<auth-source-backend auth-source-backend-3160a34> #<auth-source-backend auth-source-backend-3160aac> #<auth-source-backend auth-source-backend-3160ae0>) (:max 1 :user "username" :host "host.com" :port "plink" :require (:secret :user) :create t) 1 nil nil (:secret :user))
  auth-source-search(:max 1 :user "username" :host "host.com" :port "plink" :require (:secret :user) :create t)
  tramp-read-passwd(#<process *tramp/plink [email-masked]*>)
  tramp-action-password(#<process *tramp/plink [email-masked]*> (tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil))
  tramp-process-one-action(#<process *tramp/plink [email-masked]*> (tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-process-alive-regexp tramp-action-process-alive)))
  tramp-process-actions(#<process *tramp/plink [email-masked]*> (tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) 1 ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-process-alive-regexp tramp-action-process-alive)) 180)
  tramp-maybe-open-connection((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil))
  tramp-send-command((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) "( (test -e /home/username/ || test -h /home/...")
  tramp-send-command-and-check((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) "( (test -e /home/username/ || test -h /home/...")
  tramp-barf-unless-okay((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) "( (test -e /home/username/ || test -h /home/..." "`%s' returns with error" "( (test -e /home/username/ || test -h /home/...")
  tramp-send-command-and-read((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) "( (test -e /home/username/ || test -h /home/...")
  tramp-do-file-attributes-with-stat((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) "/home/username/" string)
  tramp-sh-handle-file-attributes("/plink:[email-masked]:/home/username/" string)
  apply(tramp-sh-handle-file-attributes ("/plink:[email-masked]:/home/username/" string))
  tramp-sh-file-name-handler(file-attributes "/plink:[email-masked]:/home/username/" string)
  apply(tramp-sh-file-name-handler file-attributes ("/plink:[email-masked]:/home/username/" string))
  tramp-file-name-handler(file-attributes "/plink:[email-masked]:/home/username/" string)
  file-attributes("/plink:[email-masked]:/home/username/" string)
  tramp-check-cached-permissions((tramp-file-name "plink" "username" nil "host.com" nil "/home/username/" nil) 114)
  tramp-sh-handle-file-readable-p("/plink:[email-masked]:/home/username/")
  apply(tramp-sh-handle-file-readable-p "/plink:[email-masked]:/home/username/")
  tramp-sh-file-name-handler(file-readable-p "/plink:[email-masked]:/home/username/")
  apply(tramp-sh-file-name-handler file-readable-p "/plink:[email-masked]:/home/username/")
  tramp-file-name-handler(file-readable-p "/plink:[email-masked]:/home/username/")
  file-readable-p("/plink:[email-masked]:/home/username/")
--8<---------------cut here---------------end--------------->8---

-- 
Best Regards
Shuguang Sun