summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-gvfs.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-10-18 19:54:13 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-10-18 19:54:13 +0200
commitf5b8f626e3d7233a935e67ffc5ffee0de9069ae5 (patch)
treefc25835e800c0e26b4663983f4780a3c53a2f780 /lisp/net/tramp-gvfs.el
parentfc988a71136b6f875823e0dc03a7c1cba102dc59 (diff)
downloademacs-f5b8f626e3d7233a935e67ffc5ffee0de9069ae5.tar.gz
emacs-f5b8f626e3d7233a935e67ffc5ffee0de9069ae5.tar.bz2
emacs-f5b8f626e3d7233a935e67ffc5ffee0de9069ae5.zip
Fix some Tramp problems
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): Use `tramp-adb-handle-file-executable-p' and `tramp-adb-handle-file-readable-p'. (tramp-adb-handle-file-executable-p) (tramp-adb-handle-file-readable-p): New defuns. (tramp-adb-handle-file-writable-p): Simplify. (tramp-adb-handle-make-process): Handle :filter being t. (tramp-adb-find-test-command): Remove. * lisp/net/tramp-sh.el (tramp-sh-handle-file-readable-p): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-readable-p): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use `tramp-handle-file-readable-p'. (tramp-gvfs-handle-file-executable-p): Do not check whether file exists, this is done in `tramp-check-cached-permissions'. (tramp-gvfs-handle-file-readable-p): Remove. * lisp/net/tramp.el (tramp-error): Move binding of `inhibit-message' ... (tramp-signal-hook-function): ... here. (tramp-handle-access-file): Rewrite. (tramp-handle-file-readable-p): New defun. (tramp-handle-make-process): Setting :filter to t works since Emacs 29.1 only. * test/lisp/net/tramp-tests.el (tramp-test17-insert-directory) (tramp-test18-file-attributes): Extend tests.
Diffstat (limited to 'lisp/net/tramp-gvfs.el')
-rw-r--r--lisp/net/tramp-gvfs.el30
1 files changed, 2 insertions, 28 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 115d005c0ca..ebe57a8bcec 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -788,7 +788,7 @@ It has been changed in GVFS 1.14.")
(file-notify-rm-watch . tramp-handle-file-notify-rm-watch)
(file-notify-valid-p . tramp-handle-file-notify-valid-p)
(file-ownership-preserved-p . ignore)
- (file-readable-p . tramp-gvfs-handle-file-readable-p)
+ (file-readable-p . tramp-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
(file-remote-p . tramp-handle-file-remote-p)
(file-selinux-context . tramp-handle-file-selinux-context)
@@ -1396,8 +1396,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
"Like `file-executable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-executable-p"
- (and (file-exists-p filename)
- (tramp-check-cached-permissions v ?x)))))
+ (tramp-check-cached-permissions v ?x))))
(defun tramp-gvfs-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
@@ -1519,31 +1518,6 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(when string (tramp-message proc 10 "Rest string:\n%s" string))
(process-put proc 'rest-string string)))
-(defun tramp-gvfs-handle-file-readable-p (filename)
- "Like `file-readable-p' for Tramp files."
- (with-parsed-tramp-file-name filename nil
- (with-tramp-file-property v localname "file-readable-p"
- (and (file-exists-p filename)
- (or (tramp-check-cached-permissions v ?r)
- ;; `tramp-check-cached-permissions' doesn't handle
- ;; symbolic links.
- (and (stringp (file-symlink-p filename))
- (file-readable-p
- (concat
- (file-remote-p filename) (file-symlink-p filename))))
- ;; If the user is different from what we guess to be
- ;; the user, we don't know. Let's check, whether
- ;; access is restricted explicitly.
- (and (/= (tramp-get-remote-uid v 'integer)
- (tramp-compat-file-attribute-user-id
- (file-attributes filename 'integer)))
- (not
- (string-equal
- "FALSE"
- (cdr (assoc
- "access::can-read"
- (tramp-gvfs-get-file-attributes filename)))))))))))
-
(defun tramp-gvfs-handle-file-system-info (filename)
"Like `file-system-info' for Tramp files."
(setq filename (directory-file-name (expand-file-name filename)))