;; Reset the transfer process properties.
(tramp-set-connection-property v "process-name" nil)
(tramp-set-connection-property v "process-buffer" nil)
- (when t1 (delete-directory tmpdir 'recurse))))
+ (when t1 (delete-directory tmpdir 'recursive))))
;; Handle KEEP-DATE argument.
(when keep-date
"Read entries which match DIRECTORY.
Either the shares are listed, or the `dir' command is executed.
Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
+ ;; If CIFS capabilities are enabled, symlinks are not listed
+ ;; by `dir'. This is a consequence of
+ ;; <https://www.samba.org/samba/news/symlink_attack.html>. See also
+ ;; <https://bugzilla.samba.org/show_bug.cgi?id=5116>.
(with-parsed-tramp-file-name (file-name-as-directory directory) nil
(setq localname (or localname "/"))
(with-tramp-file-property v localname "file-entries"
(tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
(tmp-name3 (tramp--test-make-temp-name 'local quoted))
- (tmp-name4 (tramp--test-make-temp-name nil quoted)))
-
+ (tmp-name4 (tramp--test-make-temp-name nil quoted))
+ (tmp-name5
+ (expand-file-name (file-name-nondirectory tmp-name1) tmp-name4)))
;; Check `make-symbolic-link'.
(unwind-protect
(tramp--test-ignore-make-symbolic-link-error
(funcall
(if quoted 'tramp-compat-file-name-unquote 'identity)
(file-remote-p tmp-name1 'localname))
- (file-symlink-p
- (expand-file-name
- (file-name-nondirectory tmp-name1) tmp-name4)))))
+ (file-symlink-p tmp-name5)))
+ ;; `smbclient' does not show symlinks in directories, so
+ ;; we cannot delete a non-empty directory. We delete the
+ ;; file explicitely.
+ (delete-file tmp-name5))
;; Cleanup.
(ignore-errors
(should-error
(add-name-to-file tmp-name1 tmp-name2)
:type 'file-already-exists)
- ;; number means interactive case.
+ ;; A number means interactive case.
(cl-letf (((symbol-function 'yes-or-no-p) 'ignore))
(should-error
(add-name-to-file tmp-name1 tmp-name2 0)