1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Support PuTTY's antispoof message in Tramp

* lisp/net/tramp-sh.el (tramp-actions-before-shell):
Add respective entry for PuTTY's antispoof message.

* lisp/net/tramp.el (tramp-antispoof-regexp): New defcustom.
(tramp-action-confirm-message): New defun.
This commit is contained in:
Michael Albinus 2019-10-19 14:23:21 +02:00
parent ba8944bba8
commit 21f5bd6154
2 changed files with 18 additions and 0 deletions

View file

@ -636,6 +636,16 @@ The regexp should match at end of buffer.
The answer will be provided by `tramp-action-terminal', which see."
:type 'regexp)
;; Plink 0.71 has added an additional anti-spoofing prompt after
;; authentication. This could be discarded with the argument
;; \"-no-antispoof\". However, since we don't know which PuTTY
;; version is installed, we must react interactively.
(defcustom tramp-antispoof-regexp
(regexp-quote "Access granted. Press Return to begin session. ")
"Regular expression matching plink's anti-spoofing message."
:version 27.1
:type 'regexp)
(defcustom tramp-operation-not-permitted-regexp
(concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*"
(regexp-opt '("Operation not permitted") t))
@ -3935,6 +3945,13 @@ The terminal type can be configured with `tramp-terminal-type'."
(tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line))
t)
(defun tramp-action-confirm-message (_proc vec)
"Return RET in order to confirm the message."
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec tramp-local-end-of-line)
t)
(defun tramp-action-process-alive (proc _vec)
"Check, whether a process has finished."
(unless (process-live-p proc)