summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-03-19 13:29:06 +0000
committerEli Zaretskii <eliz@gnu.org>2005-03-19 13:29:06 +0000
commit702831f54b2d6aea6796a7c3fa58b40689fd1721 (patch)
tree011eb01bef3f4566c76756ec4b2baf25770fd881
parent673e58bd171ee845414b3593b32dc4b783b08406 (diff)
downloademacs-702831f54b2d6aea6796a7c3fa58b40689fd1721.tar.gz
(backup-buffer): If the file's directory is not writable,
use copy instead of move to backup the file.
-rw-r--r--lisp/files.el1
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index ebd4d469f5c..68a1d52a2df 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2687,6 +2687,7 @@ BACKUPNAME is the backup file name, which is the old file renamed."
backup-by-copying
;; Don't rename a suid or sgid file.
(and modes (< 0 (logand modes #o6000)))
+ (not (file-writable-p (file-name-directory real-file-name)))
(and backup-by-copying-when-linked
(> (file-nlinks real-file-name) 1))
(and (or backup-by-copying-when-mismatch