aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-02-22 14:48:52 +0100
committerMichael Albinus2010-02-22 14:48:52 +0100
commit459a5f4b57987e18cd0c340cc47edb61d37c8c32 (patch)
tree35ade8c03e3863d94e10ea5981126dd5b04f1f28
parent50c58e2725507648d8d58ec6b2415e7f6d34862d (diff)
downloademacs-459a5f4b57987e18cd0c340cc47edb61d37c8c32.tar.gz
emacs-459a5f4b57987e18cd0c340cc47edb61d37c8c32.zip
* net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Protect
setting the modes by `ignore-errors'. It might fail, for example if the file is not owned by the user but the group. (tramp-handle-write-region): Ensure, that `tmpfile' is always readable.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp.el8
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c33598f6e24..541c723de2b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12010-02-22 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Protect
4 setting the modes by `ignore-errors'. It might fail, for example
5 if the file is not owned by the user but the group.
6 (tramp-handle-write-region): Ensure, that `tmpfile' is always readable.
7
12010-02-21 Chong Yidong <cyd@stupidchicken.com> 82010-02-21 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * files.el (directory-listing-before-filename-regexp): Use 10 * files.el (directory-listing-before-filename-regexp): Use
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index eed5a41e46d..102117f82e9 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3926,7 +3926,8 @@ The method used must be an out-of-band method."
3926 3926
3927 ;; Set the mode. 3927 ;; Set the mode.
3928 (unless (and keep-date copy-keep-date) 3928 (unless (and keep-date copy-keep-date)
3929 (set-file-modes newname (tramp-default-file-modes filename)))) 3929 (ignore-errors
3930 (set-file-modes newname (tramp-default-file-modes filename)))))
3930 3931
3931 ;; If the operation was `rename', delete the original file. 3932 ;; If the operation was `rename', delete the original file.
3932 (unless (eq op 'copy) 3933 (unless (eq op 'copy)
@@ -5031,7 +5032,10 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
5031 ;; filename does not exist (eq modes nil) it has been 5032 ;; filename does not exist (eq modes nil) it has been
5032 ;; renamed to the backup file. This case `save-buffer' 5033 ;; renamed to the backup file. This case `save-buffer'
5033 ;; handles permissions. 5034 ;; handles permissions.
5034 (when modes (set-file-modes tmpfile modes)) 5035 ;; Ensure, that it is still readable.
5036 (when modes
5037 (set-file-modes
5038 tmpfile (logior (or modes 0) (tramp-octal-to-decimal "0400"))))
5035 5039
5036 ;; This is a bit lengthy due to the different methods 5040 ;; This is a bit lengthy due to the different methods
5037 ;; possible for file transfer. First, we check whether the 5041 ;; possible for file transfer. First, we check whether the