aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-12-25 12:27:06 +0100
committerMichael Albinus2017-12-25 12:27:06 +0100
commit53a32e6636f391212c662f2f3d4b671e96610b7a (patch)
treeca622cf86e12fc1ddf6fa68feb590cf48eecec66
parentd87bdd2f8a5da117e5e4d7ea0c26de0f91c424f2 (diff)
downloademacs-53a32e6636f391212c662f2f3d4b671e96610b7a.tar.gz
emacs-53a32e6636f391212c662f2f3d4b671e96610b7a.zip
Fix Bug#29822
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Fix handling of restricted shells. (Bug#29822)
-rw-r--r--lisp/net/tramp-sh.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 96a0d849072..2eae8ff941e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4738,14 +4738,16 @@ connection if a previous connection has died for some reason."
4738 (if tramp-encoding-command-interactive 4738 (if tramp-encoding-command-interactive
4739 (list tramp-encoding-shell 4739 (list tramp-encoding-shell
4740 tramp-encoding-command-interactive) 4740 tramp-encoding-command-interactive)
4741 (list tramp-encoding-shell)))))) 4741 (list tramp-encoding-shell)))))
4742 current-host)
4742 4743
4743 ;; Set sentinel and query flag. 4744 ;; Set sentinel and query flag. Initialize variables.
4744 (tramp-set-connection-property p "vector" vec) 4745 (tramp-set-connection-property p "vector" vec)
4745 (set-process-sentinel p 'tramp-process-sentinel) 4746 (set-process-sentinel p 'tramp-process-sentinel)
4746 (process-put p 'adjust-window-size-function 'ignore) 4747 (process-put p 'adjust-window-size-function 'ignore)
4747 (set-process-query-on-exit-flag p nil) 4748 (set-process-query-on-exit-flag p nil)
4748 (setq tramp-current-connection (cons vec (current-time))) 4749 (setq tramp-current-connection (cons vec (current-time))
4750 current-host (system-name))
4749 4751
4750 (tramp-message 4752 (tramp-message
4751 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 4753 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
@@ -4799,8 +4801,9 @@ connection if a previous connection has died for some reason."
4799 4801
4800 ;; Check, whether there is a restricted shell. 4802 ;; Check, whether there is a restricted shell.
4801 (dolist (elt tramp-restricted-shell-hosts-alist) 4803 (dolist (elt tramp-restricted-shell-hosts-alist)
4802 (when (string-match elt l-host) 4804 (when (string-match elt current-host)
4803 (setq r-shell t))) 4805 (setq r-shell t)))
4806 (setq current-host l-host)
4804 4807
4805 ;; Set password prompt vector. 4808 ;; Set password prompt vector.
4806 (tramp-set-connection-property 4809 (tramp-set-connection-property