emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e8e7880: Some adaptions for Tramp's security key detection.


From: Michael Albinus
Subject: master e8e7880: Some adaptions for Tramp's security key detection.
Date: Sun, 22 Aug 2021 08:50:28 -0400 (EDT)

branch: master
commit e8e78809ba701eb8031120697bb9b3383473b86c
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Some adaptions for Tramp's security key detection.
    
    * lisp/net/tramp.el (tramp-security-key-timeout-regexp): New defcustom.
    (tramp-action-show-and-confirm-message): Don't use timeout, check
    for the timeout message of the ssh command.
---
 lisp/net/tramp.el | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 83df05c..b687eb7 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -714,6 +714,13 @@ The regexp should match at end of buffer."
   :version "28.1"
   :type 'regexp)
 
+(defcustom tramp-security-key-timeout-regexp
+  "^\r*sign_and_send_pubkey: signing failed for .*[\r\n]*"
+  "Regular expression matching security key timeout message.
+The regexp should match at end of buffer."
+  :version "28.1"
+  :type 'regexp)
+
 (defcustom tramp-operation-not-permitted-regexp
   (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*"
          (regexp-opt '("Operation not permitted") t))
@@ -4692,16 +4699,21 @@ The terminal type can be configured with 
`tramp-terminal-type'."
   "Show the user a message for confirmation.
 Wait, until the connection buffer changes."
   (with-current-buffer (process-buffer proc)
-    (let ((stimers (with-timeout-suspend)))
+    (let ((stimers (with-timeout-suspend))
+         (cursor-in-echo-area t)
+         set-message-function clear-message-function)
       (tramp-message vec 6 "\n%s" (buffer-string))
-      (goto-char (point-min))
       (tramp-check-for-regexp proc tramp-process-action-regexp)
       (with-temp-message (replace-regexp-in-string "[\r\n]" "" (match-string 
0))
-       (redisplay 'force)
        ;; Hide message in buffer.
        (narrow-to-region (point-max) (point-max))
        ;; Wait for new output.
-       (tramp-wait-for-regexp proc 30 tramp-security-key-confirmed-regexp))
+       (while (not (ignore-error 'file-error
+                     (tramp-wait-for-regexp
+                      proc 0.1 tramp-security-key-confirmed-regexp)))
+         (when (tramp-check-for-regexp proc tramp-security-key-timeout-regexp)
+           (throw 'tramp-action 'timeout))
+         (redisplay 'force)))
       ;; Reenable the timers.
       (with-timeout-unsuspend stimers)))
   t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]