aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-05-06 11:51:05 +0200
committerMichael Albinus2014-05-06 11:51:05 +0200
commit23e19cf290e71aacf4ad189d0ca0a51f3f967baf (patch)
tree3c434db6f825b2e0640d8dd3c2d9902c33a8f4af
parent23a9a6c8c86375a3047f799530f9da43ee6bc0fc (diff)
downloademacs-23e19cf290e71aacf4ad189d0ca0a51f3f967baf.tar.gz
emacs-23e19cf290e71aacf4ad189d0ca0a51f3f967baf.zip
Fix Bug#17415.
* net/tramp-sh.el (tramp-uudecode): Replace the hard-coded temporary file name by a format specifier. (tramp-remote-coding-commands): Enhance docstring. (tramp-find-inline-encoding): Replace "%t" by a temporary file name.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/tramp-sh.el35
2 files changed, 32 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8a6b61b891b..f5766f03063 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -9,6 +9,12 @@
9 (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. 9 (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null.
10 (Bug#17295) 10 (Bug#17295)
11 11
12 (tramp-uudecode): Replace the hard-coded temporary file name by a
13 format specifier.
14 (tramp-remote-coding-commands): Enhance docstring.
15 (tramp-find-inline-encoding): Replace "%t" by a temporary file
16 name. (Bug#17415)
17
122014-05-06 Glenn Morris <rgm@gnu.org> 182014-05-06 Glenn Morris <rgm@gnu.org>
13 19
14 * emacs-lisp/find-gc.el (find-gc-source-directory): Give it a value. 20 * emacs-lisp/find-gc.el (find-gc-source-directory): Give it a value.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 431d6183d71..900e1c812ae 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -492,9 +492,9 @@ This list is used for copying/renaming with out-of-band methods.
492See `tramp-actions-before-shell' for more info.") 492See `tramp-actions-before-shell' for more info.")
493 493
494(defconst tramp-uudecode 494(defconst tramp-uudecode
495 "(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode 495 "(echo begin 600 %t; tail -n +2) | uudecode
496cat /tmp/tramp.$$ 496cat %t
497rm -f /tmp/tramp.$$" 497rm -f %t"
498 "Shell function to implement `uudecode' to standard output. 498 "Shell function to implement `uudecode' to standard output.
499Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' 499Many systems support `uudecode -o /dev/stdout' or `uudecode -o -'
500for this or `uudecode -p', but some systems don't, and for them 500for this or `uudecode -p', but some systems don't, and for them
@@ -4039,7 +4039,7 @@ Each item is a list that looks like this:
4039 4039
4040\(FORMAT ENCODING DECODING [TEST]\) 4040\(FORMAT ENCODING DECODING [TEST]\)
4041 4041
4042FORMAT is symbol describing the encoding/decoding format. It can be 4042FORMAT is a symbol describing the encoding/decoding format. It can be
4043`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing. 4043`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing.
4044 4044
4045ENCODING and DECODING can be strings, giving commands, or symbols, 4045ENCODING and DECODING can be strings, giving commands, or symbols,
@@ -4049,9 +4049,11 @@ filename will be put into the command line at that spot. If the
4049specifier is not present, the input should be read from standard 4049specifier is not present, the input should be read from standard
4050input. 4050input.
4051 4051
4052If they are variables, this variable is a string containing a Perl 4052If they are variables, this variable is a string containing a
4053implementation for this functionality. This Perl program will be transferred 4053Perl or Shell implementation for this functionality. This
4054to the remote host, and it is available as shell function with the same name. 4054program will be transferred to the remote host, and it is
4055available as shell function with the same name. A \"%t\" format
4056specifier in the variable value denotes a temporary file.
4055 4057
4056The optional TEST command can be used for further tests, whether 4058The optional TEST command can be used for further tests, whether
4057ENCODING and DECODING are applicable.") 4059ENCODING and DECODING are applicable.")
@@ -4130,10 +4132,25 @@ Goes through the list `tramp-local-coding-commands' and
4130 (throw 'wont-work-remote nil)) 4132 (throw 'wont-work-remote nil))
4131 4133
4132 (when (not (stringp rem-dec)) 4134 (when (not (stringp rem-dec))
4133 (let ((name (symbol-name rem-dec))) 4135 (let ((name (symbol-name rem-dec))
4136 (value (symbol-value rem-dec))
4137 tmpfile)
4134 (while (string-match (regexp-quote "-") name) 4138 (while (string-match (regexp-quote "-") name)
4135 (setq name (replace-match "_" nil t name))) 4139 (setq name (replace-match "_" nil t name)))
4136 (tramp-maybe-send-script vec (symbol-value rem-dec) name) 4140 (when (string-match "%t" value)
4141 (setq tmpfile
4142 (make-temp-name
4143 (expand-file-name
4144 tramp-temp-name-prefix
4145 (tramp-get-remote-tmpdir vec)))
4146 value
4147 (format-spec
4148 value
4149 (format-spec-make
4150 ?t
4151 (tramp-file-name-handler
4152 'file-remote-p tmpfile 'localname)))))
4153 (tramp-maybe-send-script vec value name)
4137 (setq rem-dec name))) 4154 (setq rem-dec name)))
4138 (tramp-message 4155 (tramp-message
4139 vec 5 4156 vec 5