Function: tramp-clear-passwd

tramp-clear-passwd is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-clear-passwd VEC)

Documentation

Clear password cache for connection related to VEC.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-clear-passwd (vec)
  "Clear password cache for connection related to VEC."
  (let ((method (tramp-file-name-method vec))
	(user-domain (tramp-file-name-user-domain vec))
	(host-port (tramp-file-name-host-port vec))
	(hop (tramp-file-name-hop vec)))
    (when hop
      ;; Clear also the passwords of the hops.
      (tramp-clear-passwd (tramp-dissect-hop-name hop)))
    (auth-source-forget
     `(:max 1 ,(and user-domain :user) ,user-domain
       :host ,host-port :port ,method))
    (password-cache-remove (tramp-make-tramp-file-name vec 'noloc 'nohop))))