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.
This commit is contained in:
parent
f7dcad9275
commit
579b0c006e
6 changed files with 12 additions and 13 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue