diff options
| author | Michael Albinus | 2020-04-06 14:26:49 +0200 |
|---|---|---|
| committer | Michael Albinus | 2020-04-06 14:26:49 +0200 |
| commit | 3dc2f50e5bf9f58aee23fd6c61c02fadc240a377 (patch) | |
| tree | 9ea23578729ca2827acc3fcca6421bfde7cbe2a2 /lisp/net | |
| parent | fd4ee361395060c8afa95393245ac8d51655ae54 (diff) | |
| download | emacs-3dc2f50e5bf9f58aee23fd6c61c02fadc240a377.tar.gz emacs-3dc2f50e5bf9f58aee23fd6c61c02fadc240a377.zip | |
Fix case that $PATH is longer than 4096 chars in Tramp
* lisp/net/tramp-sh.el (tramp-set-remote-path): Use `tramp-send-command'
directly.
* test/lisp/net/tramp-tests.el (tramp-test-vec): New defconst.
(tramp--test-enabled, tramp--test-message)
(tramp--test-backtrace, tramp-test03-file-name-host-rules)
(tramp-test18-file-attributes, tramp-test20-file-modes)
(tramp-test26-file-name-completion)
(tramp-test33-environment-variables, tramp-test35-remote-path)
(tramp-test36-vc-registered, )
(tramp-test43-asynchronous-requests): Use it.
(tramp-test29-start-file-process, tramp-test30-make-process)
(tramp-test33-environment-variables): Remove Hydra specific result.
(tramp-test35-remote-path): Rewrite partially.
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/tramp-sh.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c770e3ce400..95425cbebc5 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -481,6 +481,7 @@ The string is used in `tramp-methods'.") | |||
| 481 | ;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin | 481 | ;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin |
| 482 | ;; IRIX64: /usr/bin | 482 | ;; IRIX64: /usr/bin |
| 483 | ;; QNAP QTS: --- | 483 | ;; QNAP QTS: --- |
| 484 | ;; Hydra: /run/current-system/sw/bin:/bin:/usr/bin | ||
| 484 | ;;;###tramp-autoload | 485 | ;;;###tramp-autoload |
| 485 | (defcustom tramp-remote-path | 486 | (defcustom tramp-remote-path |
| 486 | '(tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" | 487 | '(tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" |
| @@ -4045,11 +4046,14 @@ variable PATH." | |||
| 4045 | (if (< (length command) pipe-buf) | 4046 | (if (< (length command) pipe-buf) |
| 4046 | (tramp-send-command vec command) | 4047 | (tramp-send-command vec command) |
| 4047 | ;; Use a temporary file. | 4048 | ;; Use a temporary file. |
| 4048 | (setq tmpfile | 4049 | (setq tmpfile (tramp-make-tramp-temp-file vec)) |
| 4049 | (tramp-make-tramp-file-name vec (tramp-make-tramp-temp-file vec))) | 4050 | (tramp-send-command vec (format |
| 4050 | (write-region command nil tmpfile) | 4051 | "cat >%s <<'%s'\n%s\n%s" |
| 4051 | (tramp-send-command vec (format ". %s" (tramp-file-local-name tmpfile))) | 4052 | (tramp-shell-quote-argument tmpfile) |
| 4052 | (delete-file tmpfile)))) | 4053 | tramp-end-of-heredoc |
| 4054 | command tramp-end-of-heredoc)) | ||
| 4055 | (tramp-send-command vec (format ". %s" tmpfile)) | ||
| 4056 | (tramp-send-command vec (format "rm -f %s" tmpfile))))) | ||
| 4053 | 4057 | ||
| 4054 | ;; ------------------------------------------------------------ | 4058 | ;; ------------------------------------------------------------ |
| 4055 | ;; -- Communication with external shell -- | 4059 | ;; -- Communication with external shell -- |