Tramp: Fix bug#71709, and other minor changes

* lisp/net/tramp-message.el (tramp-backtrace): Print also in batch mode.

* lisp/net/tramp.el (tramp-skeleton-file-exists-p): Check for
property only.
(tramp-skeleton-make-process): Don't set `default-directory'.
(tramp-handle-make-process): Set it.  (Bug#71709)
This commit is contained in:
Michael Albinus 2024-06-22 19:49:45 +02:00
parent fa364a0d46
commit 8456cb9b69
4 changed files with 12 additions and 8 deletions

View file

@ -585,7 +585,7 @@ An alternative method could be chosen with `tramp-file-name-with-method'."
(tramp-make-tramp-file-name
(make-tramp-file-name
:method tramp-file-name-with-method :localname localname)))
;; Remote file with multi-hop capable method..
;; Remote file with multi-hop capable method.
((tramp-multi-hop-p v)
(tramp-make-tramp-file-name
(make-tramp-file-name

View file

@ -252,8 +252,9 @@ Also see `ignore'."
(tramp-error vec tramp-permission-denied file)
(tramp-error vec tramp-permission-denied "Permission denied: %s" file)))
;; Function `auth-info-password' is new in Emacs 29.1. However, it
;; doesn't obey cascaded functions, which is fixed in Emacs 30.1 only.
;; Function `auth-info-password' is new in Emacs 29.1. Finally,
;; Bug#49289 is fixed in Emacs 30.1 for the `secrets' and `plstore'
;; auth-sources backends.
(defalias 'tramp-compat-auth-info-password
(if (>= emacs-major-version 30)
'auth-info-password

View file

@ -357,7 +357,9 @@ This function is meant for debugging purposes."
(let ((tramp-verbose (if force 10 tramp-verbose)))
(when (>= tramp-verbose 10)
(tramp-message
vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))))))
;; In batch-mode, we want to see it on stderr.
vec-or-proc (if (and force noninteractive) 1 10)
"\n%s" (with-output-to-string (backtrace))))))
(defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments)
"Emit an error.

View file

@ -3477,7 +3477,7 @@ BODY is the backend specific code."
(with-tramp-file-property v localname "file-exists-p"
;; Examine `file-attributes' cache to see if request can
;; be satisfied without remote operation.
(if (tramp-use-file-attributes v)
(if (tramp-file-property-p v localname "file-attributes")
(not
(null (tramp-get-file-property v localname "file-attributes")))
,@body))))))
@ -3594,8 +3594,7 @@ that a stederr file is supported. BODY is the backend specific code."
(not (tramp-equal-remote default-directory stderr)))
(signal 'file-error (list "Wrong stderr" stderr)))
(let ((default-directory tramp-compat-temporary-file-directory)
(name (tramp-get-unique-process-name name))
(let ((name (tramp-get-unique-process-name name))
(buffer
(if buffer
(get-buffer-create buffer)
@ -5058,7 +5057,8 @@ should be set connection-local.")
;; Check for `tramp-sh-file-name-handler' and
;; `adb-file-name-handler-p', because something is different
;; between tramp-sh.el, and tramp-adb.el or tramp-sshfs.el.
(let* ((sh-file-name-handler-p (tramp-sh-file-name-handler-p v))
(let* ((default-directory tramp-compat-temporary-file-directory)
(sh-file-name-handler-p (tramp-sh-file-name-handler-p v))
(adb-file-name-handler-p (tramp-adb-file-name-p v))
(env (mapcar
(lambda (elt)
@ -5896,6 +5896,7 @@ Mostly useful to protect BODY from being interrupted by timers."
;; Be kind for old versions of Emacs.
(if (member 'remote-file-error debug-ignored-errors)
(throw 'non-essential 'non-essential)
;(tramp-backtrace ,proc 'force)
(tramp-error
,proc 'remote-file-error "Forbidden reentrant call of Tramp"))
(with-tramp-suspended-timers