[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1a5850a3af0 2/2: Don't report files from read-only adb partitions
From: |
Po Lu |
Subject: |
master 1a5850a3af0 2/2: Don't report files from read-only adb partitions as writable |
Date: |
Tue, 5 Mar 2024 21:48:52 -0500 (EST) |
branch: master
commit 1a5850a3af0693f022bb0a62e36bb84f762287c7
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Don't report files from read-only adb partitions as writable
* lisp/net/tramp-adb.el (tramp-adb-handle-file-writable-p):
Ignore the file-attributes cache, since file mode is not a
reliable indicator of writability.
---
lisp/net/tramp-adb.el | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 8ad7c271b4f..aaeb5fabb80 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -508,12 +508,11 @@ Emacs dired can't find files."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-writable-p"
(if (file-exists-p filename)
- ;; Examine `file-attributes' cache to see if request can be
- ;; satisfied without remote operation.
- (if (tramp-file-property-p v localname "file-attributes")
- (tramp-check-cached-permissions v ?w)
- (tramp-adb-send-command-and-check
- v (format "test -w %s" (tramp-shell-quote-argument localname))))
+ ;; The file-attributes cache is unreliable since its
+ ;; information does not take partition writability into
+ ;; account, so a call to test must never be skipped.
+ (tramp-adb-send-command-and-check
+ v (format "test -w %s" (tramp-shell-quote-argument localname)))
;; If file doesn't exist, check if directory is writable.
(and
(file-directory-p (file-name-directory filename))