diff options
| author | Michael Albinus | 2019-10-16 15:09:46 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-10-16 15:09:46 +0200 |
| commit | b70f885d582e9431ced5b1a07b526b720e70b7ba (patch) | |
| tree | 8dde60d03f29d60c7c154e9c03c0b91bdd12ea8b | |
| parent | b6babe9b4459763889d74d455005d6765df8686d (diff) | |
| download | emacs-b70f885d582e9431ced5b1a07b526b720e70b7ba.tar.gz emacs-b70f885d582e9431ced5b1a07b526b720e70b7ba.zip | |
Adapt Tramp's sudo method for non-default shells (Bug#31924)
* 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'.
| -rw-r--r-- | lisp/net/tramp-sh.el | 27 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 4 |
2 files changed, 2 insertions, 29 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index be6d29e768c..e92b9d7729b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -279,11 +279,8 @@ The string is used in `tramp-methods'.") | |||
| 279 | ;; it could be interpreted as password prompt if the | 279 | ;; it could be interpreted as password prompt if the |
| 280 | ;; remote host echoes the command. | 280 | ;; remote host echoes the command. |
| 281 | (tramp-login-args (("-u" "%u") ("-s") ("-H") | 281 | (tramp-login-args (("-u" "%u") ("-s") ("-H") |
| 282 | ("-p" "P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":"))) | 282 | ("-p" "P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":") |
| 283 | ;; Local $SHELL could be a nasty one, like zsh or | 283 | ("%l"))) |
| 284 | ;; fish. Let's override it. | ||
| 285 | (tramp-login-env (("SHELL") | ||
| 286 | (,tramp-default-remote-shell))) | ||
| 287 | (tramp-remote-shell ,tramp-default-remote-shell) | 284 | (tramp-remote-shell ,tramp-default-remote-shell) |
| 288 | (tramp-remote-shell-login ("-l")) | 285 | (tramp-remote-shell-login ("-l")) |
| 289 | (tramp-remote-shell-args ("-c")) | 286 | (tramp-remote-shell-args ("-c")) |
| @@ -4912,8 +4909,6 @@ connection if a previous connection has died for some reason." | |||
| 4912 | (remote-shell | 4909 | (remote-shell |
| 4913 | (tramp-get-method-parameter hop 'tramp-remote-shell)) | 4910 | (tramp-get-method-parameter hop 'tramp-remote-shell)) |
| 4914 | (extra-args (tramp-get-sh-extra-args remote-shell)) | 4911 | (extra-args (tramp-get-sh-extra-args remote-shell)) |
| 4915 | (login-env | ||
| 4916 | (tramp-get-method-parameter hop 'tramp-login-env)) | ||
| 4917 | (async-args | 4912 | (async-args |
| 4918 | (tramp-get-method-parameter hop 'tramp-async-args)) | 4913 | (tramp-get-method-parameter hop 'tramp-async-args)) |
| 4919 | (connection-timeout | 4914 | (connection-timeout |
| @@ -4963,24 +4958,6 @@ connection if a previous connection has died for some reason." | |||
| 4963 | (tramp-get-method-parameter | 4958 | (tramp-get-method-parameter |
| 4964 | hop 'tramp-session-timeout))) | 4959 | hop 'tramp-session-timeout))) |
| 4965 | 4960 | ||
| 4966 | ;; Add login environment. | ||
| 4967 | (when login-env | ||
| 4968 | (setq | ||
| 4969 | login-env | ||
| 4970 | (mapcar | ||
| 4971 | (lambda (x) | ||
| 4972 | (setq x (mapcar (lambda (y) (format-spec y spec)) x)) | ||
| 4973 | (unless (member "" x) (string-join x " "))) | ||
| 4974 | login-env)) | ||
| 4975 | (while login-env | ||
| 4976 | (setq command | ||
| 4977 | (format | ||
| 4978 | "%s=%s %s" | ||
| 4979 | (pop login-env) | ||
| 4980 | (tramp-shell-quote-argument (pop login-env)) | ||
| 4981 | command))) | ||
| 4982 | (setq command (concat "env " command))) | ||
| 4983 | |||
| 4984 | ;; Replace `login-args' place holders. | 4961 | ;; Replace `login-args' place holders. |
| 4985 | (setq | 4962 | (setq |
| 4986 | l-host (or l-host "") | 4963 | l-host (or l-host "") |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e51a1c7f8aa..84a6febf240 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -240,10 +240,6 @@ pair of the form (KEY VALUE). The following KEYs are defined: | |||
| 240 | absence of `tramp-copy-args', is an indication that the | 240 | absence of `tramp-copy-args', is an indication that the |
| 241 | method is capable of multi-hops. | 241 | method is capable of multi-hops. |
| 242 | 242 | ||
| 243 | * `tramp-login-env' | ||
| 244 | A list of environment variables and their values, which will | ||
| 245 | be set when calling `tramp-login-program'. | ||
| 246 | |||
| 247 | * `tramp-async-args' | 243 | * `tramp-async-args' |
| 248 | When an asynchronous process is started, we know already that | 244 | When an asynchronous process is started, we know already that |
| 249 | the connection works. Therefore, we can pass additional | 245 | the connection works. Therefore, we can pass additional |