From: Michael Albinus Date: Sat, 22 Jun 2024 17:49:45 +0000 (+0200) Subject: Tramp: Fix bug#71709, and other minor changes X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=be38090e3865f3538f9562c8ba6fb6480a9cfbcc;p=emacs.git 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) (cherry picked from commit 8456cb9b698dfbfc90af82b3ebcd739fc22be4e4) --- diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 6cd856c10e5..ecb9071eb57 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -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 diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index a324c4fa826..1d6f47dc364 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -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 diff --git a/lisp/net/tramp-message.el b/lisp/net/tramp-message.el index 685b14d14db..8d6458ce07a 100644 --- a/lisp/net/tramp-message.el +++ b/lisp/net/tramp-message.el @@ -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. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0dfd8ac4535..53f1af50878 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3467,7 +3467,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)))))) @@ -3584,8 +3584,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) @@ -5048,7 +5047,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) @@ -5886,6 +5886,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