changeset 107189:a48b193e3b5f

(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>.
author Michael Albinus <michael.albinus@gmx.de>
date Thu, 18 Feb 2010 11:03:12 +0100
parents 183412511935
children 21bb664bb922
files lisp/ChangeLog lisp/net/tramp.el
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Feb 18 01:14:12 2010 -0800
+++ b/lisp/ChangeLog	Thu Feb 18 11:03:12 2010 +0100
@@ -1,4 +1,11 @@
-2010-02-18  Glenn Morris  <rgm@gnu.org>
+2010-02-18  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (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>.
+
+22010-02-18  Glenn Morris  <rgm@gnu.org>
 
 	* emacs-lisp/authors.el (authors-renamed-files-alist):
 	Add entries for INSTALL.CVS.
--- a/lisp/net/tramp.el	Thu Feb 18 01:14:12 2010 -0800
+++ b/lisp/net/tramp.el	Thu Feb 18 11:03:12 2010 +0100
@@ -4781,12 +4781,16 @@
 			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 @@
 ;;   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 @@
 ;;   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)