Commit 158d5945 authored by Michael Albinus's avatar Michael Albinus
Browse files

* net/tramp.el (tramp-action-password, tramp-process-actions):

Revert patch from 2010-12-08.  Use `save-restriction'.
parent ffda048b
2010-12-10 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-action-password, tramp-process-actions):
Revert patch from 2010-12-08. Use `save-restriction'.
2010-12-09 Eli Zaretskii <eliz@gnu.org> 2010-12-09 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (menu-bar-frame-for-menubar, menu-bar-positive-p): * menu-bar.el (menu-bar-frame-for-menubar, menu-bar-positive-p):
......
...@@ -6712,10 +6712,9 @@ file exists and nonzero exit status otherwise." ...@@ -6712,10 +6712,9 @@ file exists and nonzero exit status otherwise."
(with-current-buffer (process-buffer proc) (with-current-buffer (process-buffer proc)
(tramp-check-for-regexp proc tramp-password-prompt-regexp) (tramp-check-for-regexp proc tramp-password-prompt-regexp)
(tramp-message vec 3 "Sending %s" (match-string 1)) (tramp-message vec 3 "Sending %s" (match-string 1))
(tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-enter-password proc) (tramp-enter-password proc)
;; Remove password prompt, in order not to find it next iteration. ;; Hide password prompt.
(delete-region (point-min) (point-max))) (narrow-to-region (point-max) (point-max))))
(defun tramp-action-succeed (proc vec) (defun tramp-action-succeed (proc vec)
"Signal success in finding shell prompt." "Signal success in finding shell prompt."
...@@ -6816,25 +6815,27 @@ The terminal type can be configured with `tramp-terminal-type'." ...@@ -6816,25 +6815,27 @@ The terminal type can be configured with `tramp-terminal-type'."
(with-temp-message "" (with-temp-message ""
;; Enable auth-source and password-cache. ;; Enable auth-source and password-cache.
(tramp-set-connection-property vec "first-password-request" t) (tramp-set-connection-property vec "first-password-request" t)
(let (exit) (save-restriction
(while (not exit) (let (exit)
(tramp-message proc 3 "Waiting for prompts from remote shell") (while (not exit)
(setq exit (tramp-message proc 3 "Waiting for prompts from remote shell")
(catch 'tramp-action (setq exit
(if timeout (catch 'tramp-action
(with-timeout (timeout) (if timeout
(tramp-process-one-action proc vec actions)) (with-timeout (timeout)
(tramp-process-one-action proc vec actions))))) (tramp-process-one-action proc vec actions))
(with-current-buffer (tramp-get-connection-buffer vec) (tramp-process-one-action proc vec actions)))))
(tramp-message vec 6 "\n%s" (buffer-string))) (with-current-buffer (tramp-get-connection-buffer vec)
(unless (eq exit 'ok) (widen)
(tramp-clear-passwd vec) (tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-error-with-buffer (unless (eq exit 'ok)
nil vec 'file-error (tramp-clear-passwd vec)
(cond (tramp-error-with-buffer
((eq exit 'permission-denied) "Permission denied") nil vec 'file-error
((eq exit 'process-died) "Process died") (cond
(t "Login failed"))))))) ((eq exit 'permission-denied) "Permission denied")
((eq exit 'process-died) "Process died")
(t "Login failed"))))))))
;; Utility functions. ;; Utility functions.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment