Function: tramp-action-password

tramp-action-password is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-action-password PROC VEC)

Documentation

Query the user for a password.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-action-password (proc vec)
  "Query the user for a password."
  (with-current-buffer (process-buffer proc)
    (let ((case-fold-search t))
      ;; Let's check whether a wrong password has been sent already.
      ;; Sometimes, the process returns a new password request
      ;; immediately after rejecting the previous (wrong) one.
      (unless (or tramp-password-prompt-not-unique
		  (tramp-get-connection-property vec "first-password-request"))
	(tramp-clear-passwd vec))
      (goto-char (point-min))
      (tramp-check-for-regexp proc tramp-process-action-regexp)
      (tramp-message vec 3 "Sending %s" (match-string 1))
      ;; We don't call `tramp-send-string' in order to hide the
      ;; password from the debug buffer and the traces.
      (process-send-string
       proc
       (concat
	(funcall
	 (if tramp-password-prompt-not-unique
	     #'tramp-read-passwd-without-cache #'tramp-read-passwd)
	 proc)
	tramp-local-end-of-line))
      ;; Hide password prompt.
      (narrow-to-region (point-max) (point-max))))
  t)