emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 53a32e6: Fix Bug#29822


From: Michael Albinus
Subject: [Emacs-diffs] master 53a32e6: Fix Bug#29822
Date: Mon, 25 Dec 2017 06:27:13 -0500 (EST)

branch: master
commit 53a32e6636f391212c662f2f3d4b671e96610b7a
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Bug#29822
    
    * lisp/net/tramp-sh.el (tramp-maybe-open-connection):
    Fix handling of restricted shells.  (Bug#29822)
---
 lisp/net/tramp-sh.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 96a0d849..2eae8ff 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."
                           (if tramp-encoding-command-interactive
                               (list tramp-encoding-shell
                                     tramp-encoding-command-interactive)
-                            (list tramp-encoding-shell))))))
+                            (list tramp-encoding-shell)))))
+                    current-host)
 
-               ;; Set sentinel and query flag.
+               ;; Set sentinel and query flag.  Initialize variables.
                (tramp-set-connection-property p "vector" vec)
                (set-process-sentinel p 'tramp-process-sentinel)
                (process-put p 'adjust-window-size-function 'ignore)
                (set-process-query-on-exit-flag p nil)
-               (setq tramp-current-connection (cons vec (current-time)))
+               (setq tramp-current-connection (cons vec (current-time))
+                     current-host (system-name))
 
                (tramp-message
                 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
@@ -4799,8 +4801,9 @@ connection if a previous connection has died for some 
reason."
 
                    ;; Check, whether there is a restricted shell.
                    (dolist (elt tramp-restricted-shell-hosts-alist)
-                     (when (string-match elt l-host)
+                     (when (string-match elt current-host)
                        (setq r-shell t)))
+                   (setq current-host l-host)
 
                    ;; Set password prompt vector.
                    (tramp-set-connection-property



reply via email to

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