From: Michael Albinus Date: Mon, 5 Jul 2021 10:09:28 +0000 (+0200) Subject: Don't use LOCKNAME for temp files in Tramp (Bug#49406) X-Git-Tag: emacs-28.0.90~1956 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=579b0c006e407aef1623f3b42d28b666426406c7;p=emacs.git Don't use LOCKNAME for temp files in Tramp (Bug#49406) * lisp/net/tramp.el (tramp-handle-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region): Don't use LOCKNAME for temp file. (Bug#49406) * test/lisp/shadowfile-tests.el (password-cache-expiry): Set `shadow-debug' also on emba. --- diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 7fb0ff57808..f9569523d94 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -533,7 +533,7 @@ But handle the case, if the \"test\" command is not available." rw-path))))))) (defun tramp-adb-handle-write-region - (start end filename &optional append visit lockname mustbenew) + (start end filename &optional append visit _lockname mustbenew) "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil @@ -549,7 +549,7 @@ But handle the case, if the \"test\" command is not available." (when (and append (file-exists-p filename)) (copy-file filename tmpfile 'ok) (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600))) - (write-region start end tmpfile append 'no-message lockname) + (write-region start end tmpfile append 'no-message) (with-tramp-progress-reporter v 3 (format-message "Moving tmp file `%s' to `%s'" tmpfile filename) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 88caa2fb7ba..5f597ff46e4 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3233,7 +3233,7 @@ implementation will be used." tmpfile))) (defun tramp-sh-handle-write-region - (start end filename &optional append visit lockname mustbenew) + (start end filename &optional append visit _lockname mustbenew) "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil @@ -3260,7 +3260,7 @@ implementation will be used." (or (file-directory-p localname) (file-writable-p localname))))) ;; Short track: if we are on the local host, we can run directly. - (write-region start end localname append 'no-message lockname) + (write-region start end localname append 'no-message) (let* ((modes (tramp-default-file-modes filename (and (eq mustbenew 'excl) 'nofollow))) @@ -3296,7 +3296,7 @@ implementation will be used." (let ((file-coding-system-alist (tramp-find-file-name-coding-system-alist filename tmpfile))) (condition-case err - (write-region start end tmpfile append 'no-message lockname) + (write-region start end tmpfile append 'no-message) ((error quit) (setq tramp-temp-buffer-file-name nil) (delete-file tmpfile) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 6fbf08801e8..13edf16756f 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1573,7 +1573,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." (error filename)))) (defun tramp-smb-handle-write-region - (start end filename &optional append visit lockname mustbenew) + (start end filename &optional append visit _lockname mustbenew) "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil @@ -1591,8 +1591,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." ;; We say `no-message' here because we don't want the visited file ;; modtime data to be clobbered from the temp file. We call ;; `set-visited-file-modtime' ourselves later on. - (tramp-run-real-handler - #'write-region (list start end tmpfile append 'no-message lockname)) + (write-region start end tmpfile append 'no-message) (with-tramp-progress-reporter v 3 (format "Moving tmp file %s to %s" tmpfile filename) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index c4a36fe2a3a..cac8c40abb3 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -279,7 +279,7 @@ arguments to pass to the OPERATION." (tramp-fuse-local-file-name filename) mode flag)))) (defun tramp-sshfs-handle-write-region - (start end filename &optional append visit lockname mustbenew) + (start end filename &optional append visit _lockname mustbenew) "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil @@ -291,7 +291,7 @@ arguments to pass to the OPERATION." (tramp-error v 'file-already-exists filename)) (write-region - start end (tramp-fuse-local-file-name filename) append 'nomessage lockname) + start end (tramp-fuse-local-file-name filename) append 'nomessage) (tramp-flush-file-properties v localname) ;; The end. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 75e44551ef9..04ec06d2512 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4355,7 +4355,7 @@ of." (t (tramp-compat-time-equal-p mt tramp-time-doesnt-exist)))))))) (defun tramp-handle-write-region - (start end filename &optional append visit lockname mustbenew) + (start end filename &optional append visit _lockname mustbenew) "Like `write-region' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil @@ -4386,7 +4386,7 @@ of." ;; We say `no-message' here because we don't want the visited file ;; modtime data to be clobbered from the temp file. We call ;; `set-visited-file-modtime' ourselves later on. - (write-region start end tmpfile append 'no-message lockname) + (write-region start end tmpfile append 'no-message) (condition-case nil (rename-file tmpfile filename 'ok-if-already-exists) (error diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index 7c9d05ac1c7..84a9479480e 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -70,7 +70,7 @@ "Temporary directory for Tramp tests.") (setq password-cache-expiry nil - shadow-debug (getenv "EMACS_HYDRA_CI") + shadow-debug (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI")) tramp-verbose 0 ;; When the remote user id is 0, Tramp refuses unsafe temporary files. tramp-allow-unsafe-temporary-files