diff options
| author | Michael Albinus | 2014-03-21 14:02:25 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-03-21 14:02:25 +0100 |
| commit | 1e92a8a3aa7958ba699cd0430be4f23aff6c4c01 (patch) | |
| tree | 0c04fa343b83db9b83036bcf98e7d501280e3161 | |
| parent | fef27dc1ad8e5b3fe4d11bf0c7711151d4c8ada8 (diff) | |
| download | emacs-1e92a8a3aa7958ba699cd0430be4f23aff6c4c01.tar.gz emacs-1e92a8a3aa7958ba699cd0430be4f23aff6c4c01.zip | |
* net/tramp.el (tramp-methods): Add docstring for `tramp-login-env'
and `tramp-copy-env'.
* net/tramp-sh.el (tramp-methods) <sudo>: Add `tramp-login-env'.
(tramp-maybe-open-connection): Handle `tramp-login-env'.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 23 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 6 |
3 files changed, 37 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 019c63c5155..4839c191ba6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-03-21 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env' | ||
| 4 | and `tramp-copy-env'. | ||
| 5 | |||
| 6 | * net/tramp-sh.el (tramp-methods) <sudo>: Add `tramp-login-env'. | ||
| 7 | (tramp-maybe-open-connection): Handle `tramp-login-env'. | ||
| 8 | |||
| 1 | 2014-03-21 Glenn Morris <rgm@gnu.org> | 9 | 2014-03-21 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * electric.el (electric-indent-post-self-insert-function): Add doc. | 11 | * electric.el (electric-indent-post-self-insert-function): Add doc. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 245d4f1ae8b..106c14805d5 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -227,6 +227,8 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 227 | '("sudo" | 227 | '("sudo" |
| 228 | (tramp-login-program "sudo") | 228 | (tramp-login-program "sudo") |
| 229 | (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) | 229 | (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) |
| 230 | ;; Local $SHELL could be a nasty one, like zsh or fish. Let's override it. | ||
| 231 | (tramp-login-env (("SHELL") ("/bin/sh"))) | ||
| 230 | (tramp-remote-shell "/bin/sh") | 232 | (tramp-remote-shell "/bin/sh") |
| 231 | (tramp-remote-shell-args ("-c")) | 233 | (tramp-remote-shell-args ("-c")) |
| 232 | (tramp-connection-timeout 10))) | 234 | (tramp-connection-timeout 10))) |
| @@ -4492,6 +4494,9 @@ connection if a previous connection has died for some reason." | |||
| 4492 | (login-args | 4494 | (login-args |
| 4493 | (tramp-get-method-parameter | 4495 | (tramp-get-method-parameter |
| 4494 | l-method 'tramp-login-args)) | 4496 | l-method 'tramp-login-args)) |
| 4497 | (login-env | ||
| 4498 | (tramp-get-method-parameter | ||
| 4499 | l-method 'tramp-login-env)) | ||
| 4495 | (async-args | 4500 | (async-args |
| 4496 | (tramp-get-method-parameter | 4501 | (tramp-get-method-parameter |
| 4497 | l-method 'tramp-async-args)) | 4502 | l-method 'tramp-async-args)) |
| @@ -4549,6 +4554,24 @@ connection if a previous connection has died for some reason." | |||
| 4549 | tramp-current-user (or g-user l-user) | 4554 | tramp-current-user (or g-user l-user) |
| 4550 | tramp-current-host (or g-host l-host)) | 4555 | tramp-current-host (or g-host l-host)) |
| 4551 | 4556 | ||
| 4557 | ;; Add login environment. | ||
| 4558 | (when login-env | ||
| 4559 | (setq | ||
| 4560 | login-env | ||
| 4561 | (mapcar | ||
| 4562 | (lambda (x) | ||
| 4563 | (setq x (mapcar (lambda (y) (format-spec y spec)) x)) | ||
| 4564 | (unless (member "" x) (mapconcat 'identity x " "))) | ||
| 4565 | login-env)) | ||
| 4566 | (while login-env | ||
| 4567 | (setq command | ||
| 4568 | (format | ||
| 4569 | "%s=%s %s" | ||
| 4570 | (pop login-env) | ||
| 4571 | (tramp-shell-quote-argument (pop login-env)) | ||
| 4572 | command))) | ||
| 4573 | (setq command (concat "env " command))) | ||
| 4574 | |||
| 4552 | ;; Replace `login-args' place holders. | 4575 | ;; Replace `login-args' place holders. |
| 4553 | (setq | 4576 | (setq |
| 4554 | l-host (or l-host "") | 4577 | l-host (or l-host "") |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5ff68e0f0f9..b9b64ed70f8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -230,6 +230,9 @@ pair of the form (KEY VALUE). The following KEYs are defined: | |||
| 230 | `tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date | 230 | `tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date |
| 231 | parameter of a program, if exists. \"%c\" adds additional | 231 | parameter of a program, if exists. \"%c\" adds additional |
| 232 | `tramp-ssh-controlmaster-options' options for the first hop. | 232 | `tramp-ssh-controlmaster-options' options for the first hop. |
| 233 | * `tramp-login-env' | ||
| 234 | A list of environment variables and their values, which will | ||
| 235 | be set when calling `tramp-login-program'. | ||
| 233 | * `tramp-async-args' | 236 | * `tramp-async-args' |
| 234 | When an asynchronous process is started, we know already that | 237 | When an asynchronous process is started, we know already that |
| 235 | the connection works. Therefore, we can pass additional | 238 | the connection works. Therefore, we can pass additional |
| @@ -242,6 +245,9 @@ pair of the form (KEY VALUE). The following KEYs are defined: | |||
| 242 | * `tramp-copy-args' | 245 | * `tramp-copy-args' |
| 243 | This specifies the list of parameters to pass to the above mentioned | 246 | This specifies the list of parameters to pass to the above mentioned |
| 244 | program, the hints for `tramp-login-args' also apply here. | 247 | program, the hints for `tramp-login-args' also apply here. |
| 248 | * `tramp-copy-env' | ||
| 249 | A list of environment variables and their values, which will | ||
| 250 | be set when calling `tramp-copy-program'. | ||
| 245 | * `tramp-copy-keep-date' | 251 | * `tramp-copy-keep-date' |
| 246 | This specifies whether the copying program when the preserves the | 252 | This specifies whether the copying program when the preserves the |
| 247 | timestamp of the original file. | 253 | timestamp of the original file. |