summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-06-28 14:41:45 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-06-28 14:41:45 +0200
commit2eba8cad204e4b663809235941d91671d2d8e6da (patch)
treef329bf768a44b6a970cf6b0667b1b518275f9169
parenta8e72eb0e26b6671df4ef8585da38e675b15745f (diff)
downloademacs-2eba8cad204e4b663809235941d91671d2d8e6da.tar.gz
Tramp shall not trap unrelated D-Bus errors
* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-vector): Declare. (tramp-gvfs-file-name-handler): Let-bind it. (tramp-gvfs-dbus-event-vector): Fix docstring. (tramp-gvfs-maybe-open-connection): Do not set it globally. (Bug#56162)
-rw-r--r--lisp/net/tramp-gvfs.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 3a5041c4918..4adc35bcb6d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -841,6 +841,8 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
(tramp-file-name-method (tramp-dissect-file-name filename))))
(and (stringp method) (member method tramp-gvfs-methods)))))
+(defvar tramp-gvfs-dbus-event-vector)
+
;;;###tramp-autoload
(defun tramp-gvfs-file-name-handler (operation &rest args)
"Invoke the GVFS related OPERATION and ARGS.
@@ -848,7 +850,11 @@ First arg specifies the OPERATION, second arg is a list of
arguments to pass to the OPERATION."
(unless tramp-gvfs-enabled
(tramp-user-error nil "Package `tramp-gvfs' not supported"))
- (if-let ((fn (assoc operation tramp-gvfs-file-name-handler-alist)))
+ (if-let ((filename (apply #'tramp-file-name-for-operation operation args))
+ (tramp-gvfs-dbus-event-vector
+ (and (tramp-tramp-file-p filename)
+ (tramp-dissect-file-name filename)))
+ (fn (assoc operation tramp-gvfs-file-name-handler-alist)))
(save-match-data (apply (cdr fn) args))
(tramp-run-real-handler operation args)))
@@ -942,7 +948,8 @@ The call will be traced by Tramp with trace level 6."
(defvar tramp-gvfs-dbus-event-vector nil
"Current Tramp file name to be used, as vector.
It is needed when D-Bus signals or errors arrive, because there
-is no information where to trace the message.")
+is no information where to trace the message.
+Globally, the value shall always be nil; it is bound where needed.")
(defun tramp-gvfs-dbus-event-error (event err)
"Called when a D-Bus error message arrives, see `dbus-event-error-functions'."
@@ -2121,10 +2128,6 @@ connection if a previous connection has died for some reason."
(unless (tramp-connectable-p vec)
(throw 'non-essential 'non-essential))
- ;; We set the file name, in case there are incoming D-Bus signals or
- ;; D-Bus errors.
- (setq tramp-gvfs-dbus-event-vector vec)
-
;; For password handling, we need a process bound to the connection
;; buffer. Therefore, we create a dummy process. Maybe there is a
;; better solution?