From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: tramp.el: remote processes and password-cache Date: Wed, 05 Mar 2014 23:41:51 +0100 Message-ID: <87iorsnu8g.fsf@fx.delysid.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1394059328 28399 80.91.229.3 (5 Mar 2014 22:42:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2014 22:42:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Kai_Gro=C3=9Fjohann?= , "Michael Albinus" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 05 23:42:15 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WLKVz-0003gI-Fd for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2014 23:42:15 +0100 Original-Received: from localhost ([::1]:54928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKVz-0000GL-21 for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2014 17:42:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKVo-0008WQ-GZ for emacs-devel@gnu.org; Wed, 05 Mar 2014 17:42:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLKVh-0004Wv-7T for emacs-devel@gnu.org; Wed, 05 Mar 2014 17:42:04 -0500 Original-Received: from fep21.mx.upcmail.net ([62.179.121.41]:49773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLKVg-0004Wd-SC for emacs-devel@gnu.org; Wed, 05 Mar 2014 17:41:57 -0500 Original-Received: from edge03.upcmail.net ([192.168.13.238]) by viefep21-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140305224154.DQLK29088.viefep21-int.chello.at@edge03.upcmail.net>; Wed, 5 Mar 2014 23:41:54 +0100 Original-Received: from fx.delysid.org ([80.109.200.215]) by edge03.upcmail.net with edge id Zyhr1n01H4fLMH403yhsic; Wed, 05 Mar 2014 23:41:54 +0100 X-SourceIP: 80.109.200.215 Original-Received: from mlang by fx.delysid.org with local (Exim 4.82) (envelope-from ) id 1WLKVb-0004V8-K8; Wed, 05 Mar 2014 23:41:51 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.179.121.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:170168 Archived-At: 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' e= lse." "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) --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95