Function: tramp-action-otp-password

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

Signature

(tramp-action-otp-password PROC VEC)

Documentation

Query the user for a one-time password.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-action-otp-password (proc vec)
  "Query the user for a one-time password."
  (with-current-buffer (process-buffer proc)
    (let ((case-fold-search t)
	  prompt)
      (goto-char (point-min))
      (tramp-check-for-regexp proc tramp-process-action-regexp)
      (setq prompt (concat (string-trim (match-string 1)) " "))
      (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
	(tramp-read-passwd-without-cache proc prompt) tramp-local-end-of-line))
      ;; Hide password prompt.
      (narrow-to-region (point-max) (point-max))))
  t)