;;; tramp-cache.el --- file information caching for Tramp
-;; Copyright (C) 2000, 2005, 2006, 2007, 2008,
-;; 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Daniel Pittman <daniel@inanna.danann.net>
;; Michael Albinus <michael.albinus@gmx.de>
(if (and (vectorp key) (not (tramp-file-name-localname key)))
(progn
(remhash "process-name" value)
- (remhash "process-buffer" value))
+ (remhash "process-buffer" value)
+ (remhash "first-password-request" value))
(remhash key cache)))
cache)
;; Dump it.
(defun tramp-process-actions (proc vec actions &optional timeout)
"Perform actions until success or TIMEOUT."
;; Enable auth-source and password-cache.
- (tramp-set-connection-property proc "first-password-request" t)
+ (tramp-set-connection-property vec "first-password-request" t)
(let (exit)
(while (not exit)
(tramp-message proc 3 "Waiting for prompts from remote shell")
(with-current-buffer (process-buffer proc)
(tramp-check-for-regexp proc tramp-password-prompt-regexp)
(format "%s for %s " (capitalize (match-string 1)) key)))))
- (prog1
- (or
- ;; See if auth-sources contains something useful, if it's bound.
- (and (boundp 'auth-sources)
- (tramp-get-connection-property proc "first-password-request" nil)
- ;; Try with Tramp's current method.
- (funcall (symbol-function 'auth-source-user-or-password)
- "password" tramp-current-host tramp-current-method))
- ;; Try the password cache.
- (when (functionp 'password-read)
- (unless (tramp-get-connection-property
- proc "first-password-request" nil)
- (funcall (symbol-function 'password-cache-remove) key))
- (let ((password
- (funcall (symbol-function 'password-read) pw-prompt key)))
- (funcall (symbol-function 'password-cache-add) key password)
- password))
- ;; Else, get the password interactively.
- (read-passwd pw-prompt))
- (tramp-set-connection-property proc "first-password-request" nil))))
+ (with-parsed-tramp-file-name key nil
+ (prog1
+ (or
+ ;; See if auth-sources contains something useful, if it's bound.
+ (and (boundp 'auth-sources)
+ (tramp-get-connection-property v "first-password-request" nil)
+ ;; Try with Tramp's current method.
+ (funcall (symbol-function 'auth-source-user-or-password)
+ "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)
+ (funcall (symbol-function 'password-cache-remove) key))
+ (let ((password
+ (funcall (symbol-function 'password-read) pw-prompt key)))
+ (funcall (symbol-function 'password-cache-add) key password)
+ password))
+ ;; Else, get the password interactively.
+ (read-passwd pw-prompt))
+ (tramp-set-connection-property v "first-password-request" nil)))))
(defun tramp-clear-passwd (vec)
"Clear password cache for connection related to VEC."
;; rsync).
;; * Keep a second connection open for out-of-band methods like scp or
;; rsync.
-;; * Support ptys in `tramp-handle-start-file-process'.
+;; * Support ptys in `tramp-handle-start-file-process'. (Bug#4604)
;; * IMHO, it's a drawback that currently Tramp doesn't support
;; Unicode in Dired file names by default. Is it possible to
;; improve Tramp to set LC_ALL to "C" only for commands where Tramp
;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448)
;; * Try telnet+curl as new method. It might be useful for busybox,
;; without built-in uuencode/uudecode.
+;; * Let `shell-dynamic-complete-*' and `comint-dynamic-complete' work
+;; on remote hosts.
+;; * Use secrets.el for password handling.
;; Functions for file-name-handler-alist:
;; diff-latest-backup-file -- in diff.el