unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
@ 2020-01-13  9:45 Pankaj Jangid
  2020-10-30 14:30 ` Lars Ingebrigtsen
  2021-09-01  6:24 ` bug#39111: [Re] " Thierry Volpiatto
  0 siblings, 2 replies; 19+ messages in thread
From: Pankaj Jangid @ 2020-01-13  9:45 UTC (permalink / raw)
  To: 39111


When I open a remote ssh file and connect to the server for the first
time, Tramp offers to save the password in ~/.authinfo even if the file
~/.authinfo.gpg exists and is already loaded (by some other package like
Gnus).

Response from Michael Albinus on the subject:
> The default value of auth-sources is '("~/.authinfo" "~/.authinfo.gpg"
> "~/.netrc")

> I suppose that auth-source checks one file after the other whether it
> exist, when searching for a password. But when it wants to save the
> password, it seems to take the first entry in auth-sources, instead of
> checking, whether one of the files exist (and use this one).

> In your case, I recommend to change the value of auth-sources to just
> '("~/.authinfo.gpg")

> However, this seems to be a bug in auth-source.el.


In GNU Emacs 27.0.60 (build 9, x86_64-apple-darwin19.2.0, NS
appkit-1894.20 Version 10.15.2 (Build 19C57))
 of 2020-01-13 built on Pankajs-MacBook-Pro.local Repository revision:
d47b157969356f15e038dbbfa4da7769f6f98583 Repository branch: emacs-27
Windowing system distributor 'Apple', version 10.3.1894 System
Description: Mac OS X 10.15.2

Recent messages: No more unseen articles No more unread articles Mark
set [2 times] Sending...  Sending via mail...  Saving file
/Users/pankaj/Mail/archive/sent/2020-01...  Wrote
/Users/pankaj/Mail/archive/sent/2020-01 Sending...done C-h C-g is
undefined Mark set

Configured using:
 'configure 'CFLAGS=-g -O0' CPPFLAGS=-I/usr/local/opt/ruby/include
 LDFLAGS=-L/usr/local/opt/ruby/lib'

Configured features: RSVG DBUS GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2
ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LC_CTYPE: UTF-8 value of $LANG: en_US locale-coding-system:
  utf-8-unix

Major mode: Article

Minor modes in effect:
  electric-pair-mode: t direnv-mode: t show-paren-mode: t
  which-key-mode: t global-hl-line-mode: t projectile-mode: t
  icomplete-mode: t shell-dirtrack-mode: t recentf-mode: t tooltip-mode:
  t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t
  tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t
  global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t
  auto-composition-mode: t auto-encryption-mode: t
  auto-compression-mode: t buffer-read-only: t line-number-mode: t
  transient-mark-mode: t

Load-path shadows: None found.

Features: (shadow emacsbug org-bullets org-element avl-tree ol-eww
ol-rmail ol-mhe ol-irc ol-info ol-gnus ol-docview doc-view jka-compr
image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m help-fns radix-tree
cl-print debug backtrace gnus-uu yenc flow-fill bbdb-message sendmail
flyspell ispell nnir shr-color vc-git diff-mode sort gnus-cite smiley
mm-archive mail-extr gnus-async gnus-bcklg qp gnus-ml disp-table
gnus-topic cursor-sensor nndraft nnmh utf-7 nnfolder bbdb-gnus epa-file
gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig
nntp gnus-cache gnus-alias gnus-sum url url-proxy url-privacy url-expand
url-methods url-history mailcap shr url-cookie url-domsuf url-util svg
xml dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums text-property-search mail-utils mm-util mail-prsvr cl-extra
company-oddmuse company-keywords company-etags etags fileloop generator
xref project company-gtags company-dabbrev-code company-dabbrev
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-template company-bbdb company
pcase display-line-numbers yasnippet help-mode elec-pair hideshow direnv
dash sanityinc-tomorrow-bright-theme color-theme-sanityinc-tomorrow
color paren which-key init server init-prog flymake-proc flymake
warnings init-edit init-keys init-looks delight hl-line init-env
exec-path-from-shell init-melpa init-tools projectile grep compile
ibuf-ext ibuffer ibuffer-loaddefs ob-C cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-python
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete org-list org-faces org-entities noutline
outline easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table
ol org-keys org-compat advice org-macs org-loaddefs find-func cal-menu
calendar cal-loaddefs bbdb-mua bbdb-com crm mailabbrev bbdb bbdb-site
timezone icomplete edmacro kmacro erc-auth erc-join erc-goodies erc
erc-backend erc-compat thingatpt pp erc-loaddefs tramp-cache tramp-sh
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
shell pcomplete comint ansi-color ring parse-time iso8601 time-date
ls-lisp format-spec recentf tree-widget wid-edit rx info package
easymenu browse-url url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
early-init tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind kqueue cocoa ns lcms2 multi-tty
make-network-process emacs)

Memory information: ((conses 16 565161 40839)
 (symbols 48 35378 2) (strings 32 116486 10645) (string-bytes 1 4103395)
 (vectors 16 57864) (vector-slots 8 942243 48072) (floats 8 569 547)
 (intervals 56 4122 347) (buffers 1000 102))

-- 
Pankaj Jangid







^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2020-01-13  9:45 bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg Pankaj Jangid
@ 2020-10-30 14:30 ` Lars Ingebrigtsen
  2020-10-31  7:21   ` Pankaj Jangid
  2021-09-01  6:24 ` bug#39111: [Re] " Thierry Volpiatto
  1 sibling, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-30 14:30 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 39111

Pankaj Jangid <p4j@j4d.net> writes:

> When I open a remote ssh file and connect to the server for the first
> time, Tramp offers to save the password in ~/.authinfo even if the file
> ~/.authinfo.gpg exists and is already loaded (by some other package like
> Gnus).

Do you also have a ~/.authinfo file?  If you have both, it'll offer to
save it into the first one in 

>> The default value of auth-sources is '("~/.authinfo" "~/.authinfo.gpg"
>> "~/.netrc")

this variable.

If not, can you `(setq debug-on-quit t)', and then hit `C-g' when it
offers to save in ~/.authinfo?  That should give us an idea what's going
wrong here.


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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2020-10-30 14:30 ` Lars Ingebrigtsen
@ 2020-10-31  7:21   ` Pankaj Jangid
  2021-08-30  1:30     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Pankaj Jangid @ 2020-10-31  7:21 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Pankaj Jangid, 39111

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> When I open a remote ssh file and connect to the server for the first
>> time, Tramp offers to save the password in ~/.authinfo even if the file
>> ~/.authinfo.gpg exists and is already loaded (by some other package like
>> Gnus).
>
> Do you also have a ~/.authinfo file?  If you have both, it'll offer to
> save it into the first one in 
>
>>> The default value of auth-sources is '("~/.authinfo" "~/.authinfo.gpg"
>>> "~/.netrc")
>
> this variable.
>
> If not, can you `(setq debug-on-quit t)', and then hit `C-g' when it
> offers to save in ~/.authinfo?  That should give us an idea what's going
> wrong here.

Today, after getting your email, when I tried it again, there was a
completely different flow.

I connected to a new machine via ‘/ssh:u@ip:~/hello.txt’. Since the
entry was not there in my ‘~/.authinfo.gpg’, it asked for password. But
tramp did not ask me to save the password. I am on (master).

I tried following configurations:

1. With my customised auth-sources which is set to
   ("~/.authinfo.gpg") and only ~/.authinfo.gpg exists
2. With my customised auth-sources which is set to
   ("~/.authinfo.gpg") and both ~/.authinfo.gpg and ~/.authinfo exist
3. With default value, which is
   ("~/.authinfo" "~/.authinfo.gpg" "~/.netrc") and only ~/.authinfo.gpg
   exists
4. With default value, which is
   ("~/.authinfo" "~/.authinfo.gpg" "~/.netrc") and both ~/.authinfo.gpg
   and ~/.authinfo exist

Same behaviour in all cases. Tramp is no longer asking to save the
password.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2020-10-31  7:21   ` Pankaj Jangid
@ 2021-08-30  1:30     ` Lars Ingebrigtsen
  2021-08-30  7:15       ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-30  1:30 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 39111, Michael Albinus

Pankaj Jangid <p4j@j4d.net> writes:

> Same behaviour in all cases. Tramp is no longer asking to save the
> password.

I'm not sure whether Tramp is supposed to (or not)?  I've added Michael
to the CCs.

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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-08-30  1:30     ` Lars Ingebrigtsen
@ 2021-08-30  7:15       ` Michael Albinus
  2021-08-30 23:59         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2021-08-30  7:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Pankaj Jangid, 39111

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Same behaviour in all cases. Tramp is no longer asking to save the
>> password.
>
> I'm not sure whether Tramp is supposed to (or not)?  I've added Michael
> to the CCs.

Tramp is involved indirectly only in this flow. If auth-source-search
returns a password save-function, it calls it.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-08-30  7:15       ` Michael Albinus
@ 2021-08-30 23:59         ` Lars Ingebrigtsen
  2021-08-31  8:13           ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-30 23:59 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Pankaj Jangid, 39111

Michael Albinus <michael.albinus@gmx.de> writes:

>>> Same behaviour in all cases. Tramp is no longer asking to save the
>>> password.
>>
>> I'm not sure whether Tramp is supposed to (or not)?  I've added Michael
>> to the CCs.
>
> Tramp is involved indirectly only in this flow. If auth-source-search
> returns a password save-function, it calls it.

I tested this now with Emacs 28 (and without ssh-agent).  When saying:

C-x C-f /ssh:stories:

and filling in user name and passphrase to my ssh key, Emacs asked
whether to save the info to ~/.authinfo (which is correct behaviour in
my case, since I have .authinfo and not .authinfo.gpg).

But that doesn't happen with "emacs -Q".  Hm...  Oh, it also asks for a
user name in the non-Q case?  Is "-Q" inhibiting usage of ~/.authinfo?
Hm...  Backtrace in -Q case:

Debugger entered--Lisp error: (minibuffer-quit "")
  signal(minibuffer-quit (""))
  tramp-error((tramp-file-name "ssh" nil nil "stories" nil "" nil) minibuffer-q$
  tramp-signal-hook-function(minibuffer-quit nil)
  signal(minibuffer-quit nil)
  #f(compiled-function () #<bytecode 0x1f41089b8ac3>)()
  read-string("Passphrase for /ssh:stories: " nil t nil)
  read-passwd("Passphrase for /ssh:stories: ")
  password-read("Passphrase for /ssh:stories: " "/ssh:stories:")
  tramp-read-passwd(#<process *tramp/ssh stories*>)
  tramp-action-password(#<process *tramp/ssh stories*> (tramp-file-name "ssh" 
  tramp-process-one-action(#<process *tramp/ssh stories*> (tramp-file-name "ss
  tramp-process-actions(#<process *tramp/ssh stories*> (tramp-file-name "ssh" 
  tramp-maybe-open-connection((tramp-file-name "ssh" nil nil "stories" nil "" 
  tramp-send-command((tramp-file-name "ssh" nil nil "stories" nil "" nil) "cd 

Backtrace in -Q case:

Debugger entered--Lisp error: (minibuffer-quit "")
  signal(minibuffer-quit (""))
  tramp-error((tramp-file-name "ssh" nil nil "stories" nil "" nil) minibuffer-
  tramp-signal-hook-function(minibuffer-quit nil)
  signal(minibuffer-quit nil)
  #f(compiled-function () #<bytecode 0x1f41089b8ac3>)()
  read-string("ssh user name for stories (default larsi): " nil nil "larsi")
  auth-source-netrc-create(:backend #<auth-source-backend auth-source-backend-
  apply(auth-source-netrc-create (:backend #<auth-source-backend auth-source-b
  auth-source-netrc-search(:backend #<auth-source-backend auth-source-backend-
  apply(auth-source-netrc-search :backend #<auth-source-backend auth-source-ba
  auth-source-search-backends((#<auth-source-backend auth-source-backend-157a4
  auth-source-search(:max 1 nil nil :host "stories" :port "ssh" :require (:sec
  tramp-read-passwd(#<process *tramp/ssh stories*>)

So the prompting comes from 

(auth-source-search :max 1 nil nil :host "stories" :port "ssh" :require '(:secret) :create t)

in tramp-read-passwd, but that's apparently not called with -Q?  (I'm
having troubles edebugging that function, because it bugs out if I try
to do that.)

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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-08-30 23:59         ` Lars Ingebrigtsen
@ 2021-08-31  8:13           ` Michael Albinus
  2021-09-01  7:50             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2021-08-31  8:13 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Pankaj Jangid, 39111

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

> I tested this now with Emacs 28 (and without ssh-agent).  When saying:
>
> C-x C-f /ssh:stories:
>
> and filling in user name and passphrase to my ssh key, Emacs asked
> whether to save the info to ~/.authinfo (which is correct behaviour in
> my case, since I have .authinfo and not .authinfo.gpg).
>
> But that doesn't happen with "emacs -Q".  Hm...  Oh, it also asks for a
> user name in the non-Q case?  Is "-Q" inhibiting usage of ~/.authinfo?

Yes, this is intended. When instructing users to hunt Tramp bugs, wrong
passwords have been in the way, several times. That's why the call to
auth-source-search is disabled when calling "emacs -Q". This is
documented in the Tramp manual, node "(tramp) Bug Reports".

If you want to debug tramp-read-passwd calling auth-source-search, you
can do the trick by

# emacs -Q --eval '(setq tramp-cache-read-persistent-data t)'

It's a dirty trick to be applied only for this use case. I've added a
comment to tramp-read-passwd explaining this, pushed to master.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: [Re] bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2020-01-13  9:45 bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg Pankaj Jangid
  2020-10-30 14:30 ` Lars Ingebrigtsen
@ 2021-09-01  6:24 ` Thierry Volpiatto
  2021-09-01 16:34   ` Michael Albinus
  1 sibling, 1 reply; 19+ messages in thread
From: Thierry Volpiatto @ 2021-09-01  6:24 UTC (permalink / raw)
  To: 39111

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]


> Yes, this is intended. When instructing users to hunt Tramp bugs, wrong
> passwords have been in the way, several times. That's why the call to
> auth-source-search is disabled when calling "emacs -Q". This is
> documented in the Tramp manual, node "(tramp) Bug Reports".
> 
> If you want to debug tramp-read-passwd calling auth-source-search, you
> can do the trick by
> 
> # emacs -Q --eval '(setq tramp-cache-read-persistent-data t)'
> 
> It's a dirty trick to be applied only for this use case. I've added a
> comment to tramp-read-passwd explaining this, pushed to master.

Note that this is (was) breaking async.el see
https://github.com/jwiegley/emacs-async/issues/80.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-08-31  8:13           ` Michael Albinus
@ 2021-09-01  7:50             ` Lars Ingebrigtsen
  2021-09-01  9:51               ` Michael Albinus
  2021-09-02 13:56               ` Pankaj Jangid
  0 siblings, 2 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-01  7:50 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Pankaj Jangid, 39111

Michael Albinus <michael.albinus@gmx.de> writes:

> Yes, this is intended. When instructing users to hunt Tramp bugs, wrong
> passwords have been in the way, several times. That's why the call to
> auth-source-search is disabled when calling "emacs -Q". This is
> documented in the Tramp manual, node "(tramp) Bug Reports".

Ah, I see.

Perhaps this should also be mentioned in, for instance, the "Startup
Summary" node in the lispref manual?

> If you want to debug tramp-read-passwd calling auth-source-search, you
> can do the trick by
>
> # emacs -Q --eval '(setq tramp-cache-read-persistent-data t)'
>
> It's a dirty trick to be applied only for this use case. I've added a
> comment to tramp-read-passwd explaining this, pushed to master.

Thanks; then everything here seems to be working as intended -- at least
in my tests.  Pankaj -- were you testing with "-Q"?  As far as I can
tell, Emacs is prompting and saving passwords properly with Emacs 28.

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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-01  7:50             ` Lars Ingebrigtsen
@ 2021-09-01  9:51               ` Michael Albinus
  2021-09-02 13:56               ` Pankaj Jangid
  1 sibling, 0 replies; 19+ messages in thread
From: Michael Albinus @ 2021-09-01  9:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Pankaj Jangid, 39111

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Yes, this is intended. When instructing users to hunt Tramp bugs, wrong
>> passwords have been in the way, several times. That's why the call to
>> auth-source-search is disabled when calling "emacs -Q". This is
>> documented in the Tramp manual, node "(tramp) Bug Reports".
>
> Ah, I see.
>
> Perhaps this should also be mentioned in, for instance, the "Startup
> Summary" node in the lispref manual?

This is a special config for Tramp only, there's no need to have it in
the lispref manual. I had to explain it two or three times the last 20
years. And now we have the comment in tramp.el, so it shall be obvious
what to do.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: [Re] bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-01  6:24 ` bug#39111: [Re] " Thierry Volpiatto
@ 2021-09-01 16:34   ` Michael Albinus
  2021-09-02  4:21     ` Thierry Volpiatto
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2021-09-01 16:34 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 39111

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

>> It's a dirty trick to be applied only for this use case. I've added a
>> comment to tramp-read-passwd explaining this, pushed to master.
>
> Note that this is (was) breaking async.el see
> https://github.com/jwiegley/emacs-async/issues/80.

I see. Do you believe we shall spend a variable, which could control
this behavior (and could be let-bound in async.el)?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: [Re] bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-01 16:34   ` Michael Albinus
@ 2021-09-02  4:21     ` Thierry Volpiatto
  2021-09-02  6:49       ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Thierry Volpiatto @ 2021-09-02  4:21 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39111

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]


Hello Michael,

Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
> Hi Thierry,
>
>>> It's a dirty trick to be applied only for this use case. I've added a
>>> comment to tramp-read-passwd explaining this, pushed to master.
>>
>> Note that this is (was) breaking async.el see
>> https://github.com/jwiegley/emacs-async/issues/80.
>
> I see. Do you believe we shall spend a variable, which could control
> this behavior (and could be let-bound in async.el)?

Hmm, I have no strong opinion on this, we are now using -q instead of -Q
and it seems to work fine. If emacs -q is loading much slower than with
-Q, so yes this would be a good reason for introducing a variable but I
have no clue it is true.

Thanks.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: [Re] bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-02  4:21     ` Thierry Volpiatto
@ 2021-09-02  6:49       ` Michael Albinus
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Albinus @ 2021-09-02  6:49 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 39111

Thierry Volpiatto <thievol@posteo.net> writes:

> Hello Michael,

Hi Thierry,

>> I see. Do you believe we shall spend a variable, which could control
>> this behavior (and could be let-bound in async.el)?
>
> Hmm, I have no strong opinion on this, we are now using -q instead of -Q
> and it seems to work fine. If emacs -q is loading much slower than with
> -Q, so yes this would be a good reason for introducing a variable but I
> have no clue it is true.

OK, so we let it as it is.

> Thanks.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-01  7:50             ` Lars Ingebrigtsen
  2021-09-01  9:51               ` Michael Albinus
@ 2021-09-02 13:56               ` Pankaj Jangid
  2021-09-03  5:59                 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 19+ messages in thread
From: Pankaj Jangid @ 2021-09-02 13:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 39111, Michael Albinus

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> If you want to debug tramp-read-passwd calling auth-source-search, you
>> can do the trick by
>>
>> # emacs -Q --eval '(setq tramp-cache-read-persistent-data t)'
>>
>> It's a dirty trick to be applied only for this use case. I've added a
>> comment to tramp-read-passwd explaining this, pushed to master.
>
> Thanks; then everything here seems to be working as intended -- at least
> in my tests.  Pankaj -- were you testing with "-Q"?  As far as I can
> tell, Emacs is prompting and saving passwords properly with Emacs 28.

I have tried to redo this using ‘emacs -Q’ as well as without using the
option ‘-Q’. Emacs is not asking to save the password in my auth file,
in both the cases.

Value of ‘auth-sources’ is currently set to ("~/.authinfo.gpg").





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-02 13:56               ` Pankaj Jangid
@ 2021-09-03  5:59                 ` Lars Ingebrigtsen
  2021-09-04  7:14                   ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-03  5:59 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: 39111, Michael Albinus

Pankaj Jangid <p4j@j4d.net> writes:

> I have tried to redo this using ‘emacs -Q’ as well as without using the
> option ‘-Q’. Emacs is not asking to save the password in my auth file,
> in both the cases.
>
> Value of ‘auth-sources’ is currently set to ("~/.authinfo.gpg").

Man...  the other day, when I tested this, Emacs was definitely asking
whether to save the credentials (when not using -Q).  Today it's not,
and I'm not sure what I'm doing different...  Hm...

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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-03  5:59                 ` Lars Ingebrigtsen
@ 2021-09-04  7:14                   ` Michael Albinus
  2021-09-05  8:40                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2021-09-04  7:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Pankaj Jangid, 39111

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

> Man...  the other day, when I tested this, Emacs was definitely asking
> whether to save the credentials (when not using -Q).  Today it's not,
> and I'm not sure what I'm doing different...  Hm...

Perhaps setting auth-source-debug gives more information?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-04  7:14                   ` Michael Albinus
@ 2021-09-05  8:40                     ` Lars Ingebrigtsen
  2021-09-05  9:32                       ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-05  8:40 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Pankaj Jangid, 39111

Michael Albinus <michael.albinus@gmx.de> 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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-05  8:40                     ` Lars Ingebrigtsen
@ 2021-09-05  9:32                       ` Eli Zaretskii
  2021-09-06  8:19                         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-09-05  9:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: p4j, 39111, michael.albinus

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sun, 05 Sep 2021 10:40:06 +0200
> Cc: Pankaj Jangid <p4j@j4d.net>, 39111@debbugs.gnu.org
> 
> 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.

Could be an error or a throw?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg
  2021-09-05  9:32                       ` Eli Zaretskii
@ 2021-09-06  8:19                         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 19+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-06  8:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: p4j, 39111, michael.albinus

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> 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.
>
> Could be an error or a throw?

`debug-on-signal' set to t doesn't reveal anything, so it must be a
throw, I think?

It has something to do with the new way that `read-char-choice' uses the
minibuffer.

If I set `read-char-choice-use-read-key' to t, then I get:


[-- Attachment #2: pass.jpg --]
[-- Type: image/jpeg, Size: 18375 bytes --]

[-- Attachment #3: Type: text/plain, Size: 179 bytes --]


So we have the prompt for find-file, and then at the same time, we have
the prompt for whether to save the password.

It also works when

(setq enable-recursive-minibuffers t)



[-- Attachment #4: Type: image/png, Size: 4621 bytes --]

[-- Attachment #5: Type: text/plain, Size: 352 bytes --]


So...  should `read-char-choice' bind `enable-recursive-minibuffers' if
`read-char-choice-use-read-key' is nil?  Because by default, these
scenarios don't work now.  (That is, using `read-char-choice' from a
command that has the minibuffer open.)

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-09-06  8:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-13  9:45 bug#39111: 27.0.60; Tramp offers to save password in ~/.authinfo instead of ~/.authinfo.gpg Pankaj Jangid
2020-10-30 14:30 ` Lars Ingebrigtsen
2020-10-31  7:21   ` Pankaj Jangid
2021-08-30  1:30     ` Lars Ingebrigtsen
2021-08-30  7:15       ` Michael Albinus
2021-08-30 23:59         ` Lars Ingebrigtsen
2021-08-31  8:13           ` Michael Albinus
2021-09-01  7:50             ` Lars Ingebrigtsen
2021-09-01  9:51               ` Michael Albinus
2021-09-02 13:56               ` Pankaj Jangid
2021-09-03  5:59                 ` Lars Ingebrigtsen
2021-09-04  7:14                   ` Michael Albinus
2021-09-05  8:40                     ` Lars Ingebrigtsen
2021-09-05  9:32                       ` Eli Zaretskii
2021-09-06  8:19                         ` Lars Ingebrigtsen
2021-09-01  6:24 ` bug#39111: [Re] " Thierry Volpiatto
2021-09-01 16:34   ` Michael Albinus
2021-09-02  4:21     ` Thierry Volpiatto
2021-09-02  6:49       ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).