all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tramp.el: remote processes and password-cache
@ 2014-03-05 22:41 Mario Lang
  2014-03-06 10:03 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Lang @ 2014-03-05 22:41 UTC (permalink / raw)
  To: Kai Großjohann, Michael Albinus; +Cc: emacs-devel

Hi.

Playing with remote processes in eshell I stumbled across
unexpected behaviour.  I have tried several methods, including scpc to
make sure that ControlMaster would be used, and as far as I can tell, it
is being used for normal TRAMP operations, since I do only have to enter
my password once.  However, when invoking a remote process, I am always
being reasked for a password, even if I invoke several remote processes
in a row.  I had expected `password-cache-expiry' to have an effect, but
it did not.  Digging through the code I found this call to
`password-cache-remove' in `tramp-read-passwd', and yes, removing the
call does solve my problem.  If I invoke several remote
processes in a row, my setting of `password-cache-expiry' is actually
honored and the password is cached.  I am sort of confused about this
code though.  As far as I can tell, removing the clearing of the cache
entry does not impose any security problems, since the password has been
cached previously already.  We just stop removing the
cache entry before it could actually get used.  However, I get the
feeling this piece of code used to do something useful.  All I can tell
from here is that removing it solves a bug I observe.  I'd actually like
to see `password-cache-expiry' to be taken into account for remote
processes.
If this is to prevent failing authentification due to changed passwords,
I think the default setting of `password-cache-expiry' is still
low enough to allow for removing of the cache clearing without
a lot of user problems.  If a user chooses to configure a much higher
cache expiry time they should be aware of that (rather rare?) problem
anyways.

Can you comment on this issue please?

--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4131,9 +4131,6 @@ Invokes `password-read' if available, `read-passwd' else."
                    "password" tramp-current-host tramp-current-method)))
 	   ;; Try the password cache.
 	   (when (functionp 'password-read)
-	     (unless (tramp-get-connection-property
-		      v "first-password-request" nil)
-	       (tramp-compat-funcall 'password-cache-remove key))
 	     (let ((password
 		    (tramp-compat-funcall 'password-read pw-prompt key)))
 	       (tramp-compat-funcall 'password-cache-add key password)

-- 
CYa,
  ⡍⠁⠗⠊⠕



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

end of thread, other threads:[~2014-03-06 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 22:41 tramp.el: remote processes and password-cache Mario Lang
2014-03-06 10:03 ` Michael Albinus
2014-03-06 13:30   ` Michael Albinus
2014-03-06 16:57     ` Mario Lang

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.