diff options
| author | Michael Albinus | 2025-04-01 15:24:44 +0200 |
|---|---|---|
| committer | Michael Albinus | 2025-04-01 15:24:44 +0200 |
| commit | 3f9ac99fc7e024678dff1ac3ff38e617ef2606fe (patch) | |
| tree | 10522887786bdf3081c62679d7ab190ef3425310 /test | |
| parent | 6cac92928a99a2cf33aeeeddf295cf981750391c (diff) | |
| download | emacs-3f9ac99fc7e024678dff1ac3ff38e617ef2606fe.tar.gz emacs-3f9ac99fc7e024678dff1ac3ff38e617ef2606fe.zip | |
Fix Tramp's file-attributes cache
* lisp/net/tramp-adb.el (tramp-adb-handle-file-executable-p):
Check also for sticky bit.
(tramp-adb-handle-file-readable-p): Simplify.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-executable-p):
Check also for sticky bit. Force `file-attributes' check.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-executable-p):
Check also for sticky bit.
(tramp-sh-handle-file-readable-p)
(tramp-sh-handle-file-writable-p): Simplify.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-executable-p):
Check also for sticky bit.
(tramp-sudoedit-handle-file-readable-p)
(tramp-sudoedit-handle-file-writable-p): Simplify.
* lisp/net/tramp.el (tramp-use-file-attributes): Fix docstring.
(tramp-handle-file-readable-p, tramp-handle-file-writable-p):
Force `file-attributes' check. Use `file-truename' for symbolic links.
(tramp-check-cached-permissions): New optional argument FORCE.
Fix symlink check. Check also for sticky bit. (Bug#77402)
* test/lisp/net/tramp-tests.el
(tramp-test20-file-modes-without-file-attributes)
(tramp-test21-file-links-without-file-attributes): New tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 605b26206c4..e22f1afc18b 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4279,6 +4279,8 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 4279 | (ignore-errors (delete-file tmp-name1)) | 4279 | (ignore-errors (delete-file tmp-name1)) |
| 4280 | (ignore-errors (delete-file tmp-name2))))))) | 4280 | (ignore-errors (delete-file tmp-name2))))))) |
| 4281 | 4281 | ||
| 4282 | (tramp--test-deftest-without-file-attributes tramp-test20-file-modes) | ||
| 4283 | |||
| 4282 | ;; Method "smb" could run into "NT_STATUS_REVISION_MISMATCH" error. | 4284 | ;; Method "smb" could run into "NT_STATUS_REVISION_MISMATCH" error. |
| 4283 | (defmacro tramp--test-ignore-add-name-to-file-error (&rest body) | 4285 | (defmacro tramp--test-ignore-add-name-to-file-error (&rest body) |
| 4284 | "Run BODY, ignoring \"error with add-name-to-file\" file error." | 4286 | "Run BODY, ignoring \"error with add-name-to-file\" file error." |
| @@ -4578,6 +4580,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4578 | (should (string-equal (file-truename dir1) (expand-file-name dir1))) | 4580 | (should (string-equal (file-truename dir1) (expand-file-name dir1))) |
| 4579 | (should (string-equal (file-truename dir2) (expand-file-name dir2))))))) | 4581 | (should (string-equal (file-truename dir2) (expand-file-name dir2))))))) |
| 4580 | 4582 | ||
| 4583 | (tramp--test-deftest-without-file-attributes tramp-test21-file-links) | ||
| 4584 | |||
| 4581 | (ert-deftest tramp-test22-file-times () | 4585 | (ert-deftest tramp-test22-file-times () |
| 4582 | "Check `set-file-times' and `file-newer-than-file-p'." | 4586 | "Check `set-file-times' and `file-newer-than-file-p'." |
| 4583 | (skip-unless (tramp--test-enabled)) | 4587 | (skip-unless (tramp--test-enabled)) |