]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp problem with non-essential
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 14 Jun 2022 11:04:34 +0000 (13:04 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 14 Jun 2022 11:04:34 +0000 (13:04 +0200)
* lisp/net/tramp.el (tramp-run-real-handler):
Handle also functions which use a `tramp-file-name' for the file
name handler.  (Bug#55832)
(tramp-get-home-directory, tramp-get-remote-uid)
(tramp-get-remote-gid): VEC can also be nil.

lisp/net/tramp.el

index 27c6dfde334e906473017b0b0c922dccc221cf50..cee8897b4f630347d3813fd5f42160cd83542750 100644 (file)
@@ -2526,6 +2526,7 @@ arguments to pass to the OPERATION."
            ,(and (eq inhibit-file-name-operation operation)
                  inhibit-file-name-handlers)))
         (inhibit-file-name-operation operation)
+        (args (if (tramp-file-name-p (car args)) (cons nil (cdr args)) args))
         signal-hook-function)
     (apply operation args)))
 
@@ -2708,6 +2709,7 @@ Fall back to normal file name handler if no Tramp file name handler exists."
                          (tramp-message
                           v 5 "Non-essential received in operation %s"
                           (cons operation args))
+                         (let ((tramp-verbose 10)) (tramp-backtrace v))
                          (tramp-run-real-handler operation args))
                         ((eq result 'suppress)
                          (let ((inhibit-message t))
@@ -2952,7 +2954,7 @@ not in completion mode."
             (m (tramp-find-method method user host))
             all-user-hosts)
 
-       (unless localname        ;; Nothing to complete.
+       (unless localname ;; Nothing to complete.
 
          (if (or user host)
 
@@ -5746,26 +5748,29 @@ be granted."
 If USER is a string, return its home directory instead of the
 user identified by VEC.  If there is no user specified in either
 VEC or USER, or if there is no home directory, return nil."
-  (with-tramp-connection-property vec (concat "~" user)
-    (tramp-file-name-handler #'tramp-get-home-directory vec user)))
+  (and (tramp-file-name-p vec)
+       (with-tramp-connection-property vec (concat "~" user)
+        (tramp-file-name-handler #'tramp-get-home-directory vec user))))
 
 (defun tramp-get-remote-uid (vec id-format)
   "The uid of the remote connection VEC, in ID-FORMAT.
 ID-FORMAT valid values are `string' and `integer'."
-  (with-tramp-connection-property vec (format "uid-%s" id-format)
-    (or (tramp-file-name-handler #'tramp-get-remote-uid vec id-format)
-       ;; Ensure there is a valid result.
-       (and (equal id-format 'integer) tramp-unknown-id-integer)
-       (and (equal id-format 'string) tramp-unknown-id-string))))
+  (or (and (tramp-file-name-p vec)
+          (with-tramp-connection-property vec (format "uid-%s" id-format)
+            (tramp-file-name-handler #'tramp-get-remote-uid vec id-format)))
+      ;; Ensure there is a valid result.
+      (and (equal id-format 'integer) tramp-unknown-id-integer)
+      (and (equal id-format 'string) tramp-unknown-id-string)))
 
 (defun tramp-get-remote-gid (vec id-format)
   "The gid of the remote connection VEC, in ID-FORMAT.
 ID-FORMAT valid values are `string' and `integer'."
-  (with-tramp-connection-property vec (format "gid-%s" id-format)
-    (or (tramp-file-name-handler #'tramp-get-remote-gid vec id-format)
-       ;; Ensure there is a valid result.
-       (and (equal id-format 'integer) tramp-unknown-id-integer)
-       (and (equal id-format 'string) tramp-unknown-id-string))))
+  (or (and (tramp-file-name-p vec)
+          (with-tramp-connection-property vec (format "gid-%s" id-format)
+            (tramp-file-name-handler #'tramp-get-remote-gid vec id-format)))
+      ;; Ensure there is a valid result.
+      (and (equal id-format 'integer) tramp-unknown-id-integer)
+      (and (equal id-format 'string) tramp-unknown-id-string)))
 
 (defun tramp-local-host-p (vec)
   "Return t if this points to the local host, nil otherwise.