unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27108: 26.0.50; tramp and recentf again
@ 2017-05-27 21:26 Stephen Berman
  2017-05-31  9:51 ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Berman @ 2017-05-27 21:26 UTC (permalink / raw)
  To: 27108

Starting with this change:

   commit dca22e86e02d16a31128c163925b13404f777c0f
   Author: Michael Albinus <michael.albinus@gmx.de>
   Date:   Wed May 24 16:16:53 2017 +0200
   
     Introduce a defstruct `tramp-file-name' as central data structure.

when I start emacs with recentf-mode enabled and the ~/.emacs.d/recentf
contains a tramp-sensitive entry, e.g. this:

--8<---------------cut here---------------start------------->8---
;;; Automatically generated by ‘recentf’ on Sat May 27 11:51:22 2017.

(setq recentf-list
      '(
        "/su:root@rosalinde:/etc/"
        ))

(setq recentf-filter-changer-current 'nil)

\f
;; Local Variables:
;; coding: utf-8-emacs
;; End:
--8<---------------cut here---------------end--------------->8---

Emacs then prompts for the password for the file
"/su:root@rosalinde:/etc/".  Likewise for e.g. a remote file accessed
via sftp.

The problem also happens when I have the above recentf file and start
emacs like this: 

emacs -Q --eval "(custom-set-variables '(recentf-mode t))"

This recalls bug#26258 but now there is no error, just the login prompt.


In GNU Emacs 26.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version 3.22.8)
 of 2017-05-27 built on rosalinde
Repository revision: 527a7cc9425370f7217a4d2b6914b96dff6f5ec1
Windowing system distributor 'The X.Org Foundation', version 11.0.11901000

Configured using:
 'configure 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11

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





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

* bug#27108: 26.0.50; tramp and recentf again
  2017-05-27 21:26 bug#27108: 26.0.50; tramp and recentf again Stephen Berman
@ 2017-05-31  9:51 ` Michael Albinus
  2017-05-31 14:19   ` Stephen Berman
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2017-05-31  9:51 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 27108

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

Stephen Berman <stephen.berman@gmx.net> writes:

Hi Stephen,

> Starting with this change:
>
>    commit dca22e86e02d16a31128c163925b13404f777c0f
>    Author: Michael Albinus <michael.albinus@gmx.de>
>    Date:   Wed May 24 16:16:53 2017 +0200
>
>      Introduce a defstruct `tramp-file-name' as central data structure.
>
> The problem also happens when I have the above recentf file and start
> emacs like this:
>
> emacs -Q --eval "(custom-set-variables '(recentf-mode t))"
>
> This recalls bug#26258 but now there is no error, just the login prompt.

Thanks for the report. I could reproduce it locally. However, I don't
know whether this counts as a bug.

The password request comes from the function
`file-name-case-insensitive-p', called when recentf scans the saved file
name list. Tramp has different approaches to implement this function;
for the sudo method (as in your case) it performs some tests on the
remote account. Usually, you don't see this, because Tramp keeps the
result of this function in its own persistency file "~/.emacs.d/tramp".

As you have observed, it didn't work this way after the switch to use
defstruct's in Tramp. Due to this change, the data in Tramp's
persistency file were invalid, and they were ignored at startup. Tramp's
`file-name-case-insensitive-p' implementation couldn't use the cached
value, and so it tried to recompute it, accessing the sudo account,
asking for the password.

As a skilled bug hunter, you have tried to find the problem by starting
further Emacs instances with "emacs -Q". But when Emacs is started with
the "-Q" argument, Tramp doesn't read its persistency file, it doesn't
know the cached value, and you have the same problem. So it looks like a
bug.

I'm pretty sure, if you continue to work the usual way, calling Emacs
w/o "-Q", the problem disappears latest after the second Emacs startup,
because the cached value is available then from the persistency
file. That's why I believe it isn't a bug.

OTOH, I understand that the problem is annoying when it appears, and
when it isn't obvious why this happens. The appended small patch in
`recentf-load-list' would avoid this, instructing Tramp not to open a
new connection while reading the previously saved recent list. Would it
be OK to apply this patch?

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 602 bytes --]

diff --git a/lisp/recentf.el b/lisp/recentf.el
index 4f0573911b..462ccb6db5 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1304,7 +1304,9 @@ recentf-load-list
 When `recentf-initialize-file-name-history' is non-nil, initialize an
 empty `file-name-history' with the recent list."
   (interactive)
-  (let ((file (expand-file-name recentf-save-file)))
+  (let ((file (expand-file-name recentf-save-file))
+        ;; We do not want Tramp asking for passwords.
+        (non-essential t))
     (when (file-readable-p file)
       (load-file file)
       (and recentf-initialize-file-name-history

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

* bug#27108: 26.0.50; tramp and recentf again
  2017-05-31  9:51 ` Michael Albinus
@ 2017-05-31 14:19   ` Stephen Berman
  2017-05-31 18:35     ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Berman @ 2017-05-31 14:19 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 27108

On Wed, 31 May 2017 11:51:47 +0200 Michael Albinus <michael.albinus@gmx.de> wrote:

[...]
> I'm pretty sure, if you continue to work the usual way, calling Emacs
> w/o "-Q", the problem disappears latest after the second Emacs startup,
> because the cached value is available then from the persistency
> file. That's why I believe it isn't a bug.

You're right.  I accessed a remote file via sftp last night and its name
was saved to the recentf file on exiting Emacs, and when I started Emacs
today, there was no password request.

> OTOH, I understand that the problem is annoying when it appears, and
> when it isn't obvious why this happens. The appended small patch in
> `recentf-load-list' would avoid this, instructing Tramp not to open a
> new connection while reading the previously saved recent list. Would it
> be OK to apply this patch?

IIUC, this would suppress the password request on starting Emacs, but
leave the remote file name in the recentf list?  That sounds like a good
solution to me.  Thanks.

Steve Berman





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

* bug#27108: 26.0.50; tramp and recentf again
  2017-05-31 14:19   ` Stephen Berman
@ 2017-05-31 18:35     ` Michael Albinus
  2017-05-31 20:01       ` Stephen Berman
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2017-05-31 18:35 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 27108

Stephen Berman <stephen.berman@gmx.net> writes:

Hi Stephen,

> IIUC, this would suppress the password request on starting Emacs, but
> leave the remote file name in the recentf list?  That sounds like a good
> solution to me.

Exactly. I've committed the patch to master, pls crosscheck.

> Thanks.
>
> Steve Berman

Best regards, Michael.





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

* bug#27108: 26.0.50; tramp and recentf again
  2017-05-31 18:35     ` Michael Albinus
@ 2017-05-31 20:01       ` Stephen Berman
  2017-06-01  7:18         ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Berman @ 2017-05-31 20:01 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 27108

On Wed, 31 May 2017 20:35:01 +0200 Michael Albinus <michael.albinus@gmx.de> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
> Hi Stephen,
>
>> IIUC, this would suppress the password request on starting Emacs, but
>> leave the remote file name in the recentf list?  That sounds like a good
>> solution to me.
>
> Exactly. I've committed the patch to master, pls crosscheck.

I updated from master, deleted the ~/.emacs.d/tramp file, made sure the
~/.emacs.d/recentf file had remote password-assessible files, started
Emacs, and got no password prompt.  So it works; thanks.

Steve Berman





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

* bug#27108: 26.0.50; tramp and recentf again
  2017-05-31 20:01       ` Stephen Berman
@ 2017-06-01  7:18         ` Michael Albinus
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Albinus @ 2017-06-01  7:18 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 27108-done

Stephen Berman <stephen.berman@gmx.net> writes:

Hi Stephen,

> I updated from master, deleted the ~/.emacs.d/tramp file, made sure the
> ~/.emacs.d/recentf file had remote password-assessible files, started
> Emacs, and got no password prompt.  So it works; thanks.

Thanks for checking, I'm closing the bug.

> Steve Berman

Best regards, Michael.





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

end of thread, other threads:[~2017-06-01  7:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-27 21:26 bug#27108: 26.0.50; tramp and recentf again Stephen Berman
2017-05-31  9:51 ` Michael Albinus
2017-05-31 14:19   ` Stephen Berman
2017-05-31 18:35     ` Michael Albinus
2017-05-31 20:01       ` Stephen Berman
2017-06-01  7:18         ` 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).