emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 67fe106: Some minor improvements for share handling in tramp-gvfs


From: Michael Albinus
Subject: master 67fe106: Some minor improvements for share handling in tramp-gvfs.el
Date: Mon, 26 Jul 2021 14:52:06 -0400 (EDT)

branch: master
commit 67fe106d1007d3cef58aa789327ad66ed71e4902
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Some minor improvements for share handling in tramp-gvfs.el
    
    * lisp/net/tramp-gvfs.el (tramp-gvfs-connection-mounted-p):
    Set "share" connection property if the mount spec offers it.
    (tramp-gvfs-handle-get-remote-uid)
    (tramp-gvfs-handle-get-remote-gid): Use it.
---
 lisp/net/tramp-cache.el |  4 ++--
 lisp/net/tramp-gvfs.el  | 15 +++++++++++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 579234f..fcfad01 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -72,8 +72,8 @@
 ;;   process key retrieved by `tramp-get-process' (the main connection
 ;;   process).  Other processes could reuse these properties, avoiding
 ;;   recomputation when a new asynchronous process is created by
-;;   `make-process'.  Examples are "remote-path",
-;;   "unsafe-temporary-file" or "device" (tramp-adb.el).
+;;   `make-process'.  Examples are "unsafe-temporary-file",
+;;   "remote-path", "device" (tramp-adb.el) or "share" (tramp-gvfs.el).
 
 ;;; Code:
 
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index db561b4..eff14a2 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1633,8 +1633,10 @@ If FILE-SYSTEM is non-nil, return file system 
attributes."
 ID-FORMAT valid values are `string' and `integer'."
   (if (equal id-format 'string)
       (tramp-file-name-user vec)
-    (when-let
-       ((localname (tramp-get-connection-property vec "default-location" nil)))
+    (when-let ((localname
+               (tramp-get-connection-property
+                (tramp-get-process vec) "share"
+                (tramp-get-connection-property vec "default-location" nil))))
       (tramp-compat-file-attribute-user-id
        (file-attributes
        (tramp-make-tramp-file-name vec localname) id-format)))))
@@ -1642,8 +1644,10 @@ ID-FORMAT valid values are `string' and `integer'."
 (defun tramp-gvfs-handle-get-remote-gid (vec id-format)
   "The gid of the remote connection VEC, in ID-FORMAT.
 ID-FORMAT valid values are `string' and `integer'."
-  (when-let
-      ((localname (tramp-get-connection-property vec "default-location" nil)))
+  (when-let ((localname
+             (tramp-get-connection-property
+              (tramp-get-process vec) "share"
+              (tramp-get-connection-property vec "default-location" nil))))
     (tramp-compat-file-attribute-group-id
      (file-attributes
       (tramp-make-tramp-file-name vec localname) id-format))))
@@ -1997,6 +2001,9 @@ a downcased host name only."
           (tramp-set-file-property vec "/" "fuse-mountpoint" fuse-mountpoint)
           (tramp-set-connection-property
            vec "default-location" default-location)
+          (when share
+            (tramp-set-connection-property
+             (tramp-get-process vec) "share" (concat "/" share)))
           (throw 'mounted t)))))))
 
 (defun tramp-gvfs-unmount (vec)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]