]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't report files from read-only adb partitions as writable
authorPo Lu <luangruo@yahoo.com>
Wed, 6 Mar 2024 02:48:28 +0000 (10:48 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 6 Mar 2024 11:36:50 +0000 (12:36 +0100)
* 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.

(cherry picked from commit 1a5850a3af0693f022bb0a62e36bb84f762287c7)

lisp/net/tramp-adb.el

index 8ad7c271b4fe182d28e9b7bf280878fddd28b261..aaeb5fabb80c2b4456ac220eeaa629d67bc7c5e9 100644 (file)
@@ -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))