diff options
| -rw-r--r-- | lisp/net/tramp-smb.el | 6 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index ee6baaab121..35aa8110946 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -535,7 +535,7 @@ pass to the OPERATION." | |||
| 535 | ;; Reset the transfer process properties. | 535 | ;; Reset the transfer process properties. |
| 536 | (tramp-set-connection-property v "process-name" nil) | 536 | (tramp-set-connection-property v "process-name" nil) |
| 537 | (tramp-set-connection-property v "process-buffer" nil) | 537 | (tramp-set-connection-property v "process-buffer" nil) |
| 538 | (when t1 (delete-directory tmpdir 'recurse)))) | 538 | (when t1 (delete-directory tmpdir 'recursive)))) |
| 539 | 539 | ||
| 540 | ;; Handle KEEP-DATE argument. | 540 | ;; Handle KEEP-DATE argument. |
| 541 | (when keep-date | 541 | (when keep-date |
| @@ -1583,6 +1583,10 @@ If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"." | |||
| 1583 | "Read entries which match DIRECTORY. | 1583 | "Read entries which match DIRECTORY. |
| 1584 | Either the shares are listed, or the `dir' command is executed. | 1584 | Either the shares are listed, or the `dir' command is executed. |
| 1585 | Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." | 1585 | Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." |
| 1586 | ;; If CIFS capabilities are enabled, symlinks are not listed | ||
| 1587 | ;; by `dir'. This is a consequence of | ||
| 1588 | ;; <https://www.samba.org/samba/news/symlink_attack.html>. See also | ||
| 1589 | ;; <https://bugzilla.samba.org/show_bug.cgi?id=5116>. | ||
| 1586 | (with-parsed-tramp-file-name (file-name-as-directory directory) nil | 1590 | (with-parsed-tramp-file-name (file-name-as-directory directory) nil |
| 1587 | (setq localname (or localname "/")) | 1591 | (setq localname (or localname "/")) |
| 1588 | (with-tramp-file-property v localname "file-entries" | 1592 | (with-tramp-file-property v localname "file-entries" |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 88e97092ed7..bfdc3017804 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2653,8 +2653,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2653 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) | 2653 | (tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 2654 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 2654 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 2655 | (tmp-name3 (tramp--test-make-temp-name 'local quoted)) | 2655 | (tmp-name3 (tramp--test-make-temp-name 'local quoted)) |
| 2656 | (tmp-name4 (tramp--test-make-temp-name nil quoted))) | 2656 | (tmp-name4 (tramp--test-make-temp-name nil quoted)) |
| 2657 | 2657 | (tmp-name5 | |
| 2658 | (expand-file-name (file-name-nondirectory tmp-name1) tmp-name4))) | ||
| 2658 | ;; Check `make-symbolic-link'. | 2659 | ;; Check `make-symbolic-link'. |
| 2659 | (unwind-protect | 2660 | (unwind-protect |
| 2660 | (tramp--test-ignore-make-symbolic-link-error | 2661 | (tramp--test-ignore-make-symbolic-link-error |
| @@ -2716,9 +2717,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2716 | (funcall | 2717 | (funcall |
| 2717 | (if quoted 'tramp-compat-file-name-unquote 'identity) | 2718 | (if quoted 'tramp-compat-file-name-unquote 'identity) |
| 2718 | (file-remote-p tmp-name1 'localname)) | 2719 | (file-remote-p tmp-name1 'localname)) |
| 2719 | (file-symlink-p | 2720 | (file-symlink-p tmp-name5))) |
| 2720 | (expand-file-name | 2721 | ;; `smbclient' does not show symlinks in directories, so |
| 2721 | (file-name-nondirectory tmp-name1) tmp-name4))))) | 2722 | ;; we cannot delete a non-empty directory. We delete the |
| 2723 | ;; file explicitely. | ||
| 2724 | (delete-file tmp-name5)) | ||
| 2722 | 2725 | ||
| 2723 | ;; Cleanup. | 2726 | ;; Cleanup. |
| 2724 | (ignore-errors | 2727 | (ignore-errors |
| @@ -2737,7 +2740,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2737 | (should-error | 2740 | (should-error |
| 2738 | (add-name-to-file tmp-name1 tmp-name2) | 2741 | (add-name-to-file tmp-name1 tmp-name2) |
| 2739 | :type 'file-already-exists) | 2742 | :type 'file-already-exists) |
| 2740 | ;; number means interactive case. | 2743 | ;; A number means interactive case. |
| 2741 | (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) | 2744 | (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) |
| 2742 | (should-error | 2745 | (should-error |
| 2743 | (add-name-to-file tmp-name1 tmp-name2 0) | 2746 | (add-name-to-file tmp-name1 tmp-name2 0) |