aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus2010-10-30 18:28:17 +0200
committerMichael Albinus2010-10-30 18:28:17 +0200
commita057950d77bbd03434f6a286c81a259824d7b7ad (patch)
tree8f59850f4b72f3c83f8b93a4f1fea9597e3ac249 /lisp/net
parentd2ce10d221f16a8e03a7c4363d9ad61984087ff0 (diff)
downloademacs-a057950d77bbd03434f6a286c81a259824d7b7ad.tar.gz
emacs-a057950d77bbd03434f6a286c81a259824d7b7ad.zip
* net/tramp.el (tramp-handle-insert-file-contents): For root,
preserve owner and group when editing files. (Bug#7289) Please contact me, if you have problems syncing with the trunk.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 426785dd9a4..50fbaed01e0 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5008,7 +5008,11 @@ coding system might not be determined. This function repairs it."
5008 (setq buffer-file-name filename) 5008 (setq buffer-file-name filename)
5009 (setq buffer-read-only (not (file-writable-p filename))) 5009 (setq buffer-read-only (not (file-writable-p filename)))
5010 (set-visited-file-modtime) 5010 (set-visited-file-modtime)
5011 (set-buffer-modified-p nil)) 5011 (set-buffer-modified-p nil)
5012 ;; For root, preserve owner and group when editing files.
5013 (when (string-equal (file-remote-p filename 'user) "root")
5014 (set (make-local-variable 'backup-by-copying-when-mismatch) t)
5015 (put 'backup-by-copying-when-mismatch 'permanent-local t)))
5012 (when (and (stringp local-copy) 5016 (when (and (stringp local-copy)
5013 (or remote-copy (null tramp-temp-buffer-file-name))) 5017 (or remote-copy (null tramp-temp-buffer-file-name)))
5014 (delete-file local-copy)) 5018 (delete-file local-copy))