summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2010-02-18 11:03:12 +0100
committerMichael Albinus <michael.albinus@gmx.de>2010-02-18 11:03:12 +0100
commit6e4f5731f6620d147d4937ed2be2544720e01041 (patch)
tree21bdf4b3172a5bd76d36d2001cc8d227e9e5762a /lisp/net
parent272f6ebf1e639e3d3d3b106a3b8c665436d386db (diff)
downloademacs-6e4f5731f6620d147d4937ed2be2544720e01041.tar.gz
(tramp-handle-insert-file-contents): Set always the permissions of the
temporary file to "0600". In case the remote file has no read permissions for the owner, there might be problems otherwise. Reported by Ole Laursen <olau@iola.dk>.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el22
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 77a3875eeb4..d15d245d01f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4781,12 +4781,16 @@ coding system might not be determined. This function repairs it."
tramp-temp-buffer-file-name)
(t (file-local-copy filename)))))
+ ;; When the file is not readable for the owner, it
+ ;; cannot be inserted, even it is redable for the group
+ ;; or for everybody.
+ (set-file-modes local-copy (tramp-octal-to-decimal "0600"))
+
(when (and (null remote-copy)
(tramp-get-method-parameter
method 'tramp-copy-keep-tmpfile))
;; We keep the local file for performance reasons,
;; useful for "rsync".
- (set-file-modes local-copy (tramp-octal-to-decimal "0600"))
(setq tramp-temp-buffer-file-name local-copy)
(put 'tramp-temp-buffer-file-name 'permanent-local t))
@@ -8584,26 +8588,26 @@ Only works for Bourne-like shells."
;; equivalent of the emacsclient -eval option in order to make this
;; reasonably unproblematic. And maybe trampclient should have some
;; way of passing credentials, like by using an SSL socket or
-;; something. (David Kastrup)
+;; something. (David Kastrup)
;; * Reconnect directly to a compliant shell without first going
-;; through the user's default shell. (Pete Forman)
+;; through the user's default shell. (Pete Forman)
;; * Make `tramp-default-user' obsolete.
;; * How can I interrupt the remote process with a signal
-;; (interrupt-process seems not to work)? (Markus Triska)
+;; (interrupt-process seems not to work)? (Markus Triska)
;; * Avoid the local shell entirely for starting remote processes. If
;; so, I think even a signal, when delivered directly to the local
;; SSH instance, would correctly be propagated to the remote process
;; automatically; possibly SSH would have to be started with
-;; "-t". (Markus Triska)
+;; "-t". (Markus Triska)
;; * It makes me wonder if tramp couldn't fall back to ssh when scp
-;; isn't on the remote host. (Mark A. Hershberger)
-;; * Use lsh instead of ssh. (Alfred M. Szmidt)
+;; isn't on the remote host. (Mark A. Hershberger)
+;; * Use lsh instead of ssh. (Alfred M. Szmidt)
;; * Implement a general server-local-variable mechanism, as there are
;; probably other variables that need different values for different
;; servers too. The user could then configure a variable (such as
;; tramp-server-local-variable-alist) to define any such variables
;; that they need to, which would then be let bound as appropriate
-;; in tramp functions. (Jason Rumney)
+;; in tramp functions. (Jason Rumney)
;; * Optimize out-of-band copying, when both methods are scp-like (not
;; rsync).
;; * Keep a second connection open for out-of-band methods like scp or
@@ -8613,7 +8617,7 @@ Only works for Bourne-like shells."
;; Unicode in Dired file names by default. Is it possible to
;; improve Tramp to set LC_ALL to "C" only for commands where Tramp
;; expects English? Or just to set LC_MESSAGES to "C" if Tramp
-;; expects only English messages? (Juri Linkov)
+;; expects only English messages? (Juri Linkov)
;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846)
;; * Do not handle files with drive letter as remote. (Bug#5447)
;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448)