]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt Tramp's sudo method for non-default shells (Bug#31924)
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 16 Oct 2019 13:09:46 +0000 (15:09 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 16 Oct 2019 13:09:46 +0000 (15:09 +0200)
* lisp/net/tramp-sh.el (tramp-methods) <sudo>: Change template.
(tramp-maybe-open-connection): Remove `tramp-login-env'.  (Bug#31924)

* lisp/net/tramp.el (tramp-methods): Remove docstring for `tramp-login-env'.

lisp/net/tramp-sh.el
lisp/net/tramp.el

index be6d29e768cb4f31a8a14619063091da7459fb08..e92b9d7729b3b107b61cb2711b923cd0b39b05a8 100644 (file)
@@ -279,11 +279,8 @@ The string is used in `tramp-methods'.")
                 ;; it could be interpreted as password prompt if the
                 ;; remote host echoes the command.
                 (tramp-login-args           (("-u" "%u") ("-s") ("-H")
-                                            ("-p" "P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":")))
-                ;; Local $SHELL could be a nasty one, like zsh or
-                ;; fish.  Let's override it.
-                (tramp-login-env            (("SHELL")
-                                            (,tramp-default-remote-shell)))
+                                            ("-p" "P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":")
+                                             ("%l")))
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
                 (tramp-remote-shell-args    ("-c"))
@@ -4912,8 +4909,6 @@ connection if a previous connection has died for some reason."
                         (remote-shell
                          (tramp-get-method-parameter hop 'tramp-remote-shell))
                         (extra-args (tramp-get-sh-extra-args remote-shell))
-                        (login-env
-                         (tramp-get-method-parameter hop 'tramp-login-env))
                         (async-args
                          (tramp-get-method-parameter hop 'tramp-async-args))
                         (connection-timeout
@@ -4963,24 +4958,6 @@ connection if a previous connection has died for some reason."
                       (tramp-get-method-parameter
                        hop 'tramp-session-timeout)))
 
-                   ;; Add login environment.
-                   (when login-env
-                     (setq
-                      login-env
-                      (mapcar
-                       (lambda (x)
-                         (setq x (mapcar (lambda (y) (format-spec y spec)) x))
-                         (unless (member "" x) (string-join x " ")))
-                       login-env))
-                     (while login-env
-                       (setq command
-                             (format
-                              "%s=%s %s"
-                              (pop login-env)
-                              (tramp-shell-quote-argument (pop login-env))
-                              command)))
-                     (setq command (concat "env " command)))
-
                    ;; Replace `login-args' place holders.
                    (setq
                     l-host (or l-host "")
index e51a1c7f8aa9ecacada3c48114c968eead23ce85..84a6febf240a5fde8a5682e76c0d1157e01fb574 100644 (file)
@@ -240,10 +240,6 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
     absence of `tramp-copy-args', is an indication that the
     method is capable of multi-hops.
 
-  * `tramp-login-env'
-     A list of environment variables and their values, which will
-     be set when calling `tramp-login-program'.
-
   * `tramp-async-args'
     When an asynchronous process is started, we know already that
     the connection works.  Therefore, we can pass additional