[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 49cd561: * test/lisp/tramp-tests.el (tramp-test21
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] emacs-26 49cd561: * test/lisp/tramp-tests.el (tramp-test21-file-links): Special code for smb. |
Date: |
Mon, 25 Sep 2017 11:52:35 -0400 (EDT) |
branch: emacs-26
commit 49cd561dc62ea6b3fbedab7aef0f020733f4cf09
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
* test/lisp/tramp-tests.el (tramp-test21-file-links): Special code for smb.
---
lisp/net/tramp-smb.el | 6 +++++-
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 ee6baaa..35aa811 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -535,7 +535,7 @@ pass to the OPERATION."
;; 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
@@ -1583,6 +1583,10 @@ If VEC has no cifs capabilities, exchange \"/\" by
\"\\\\\"."
"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"
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 88e9709..bfdc301 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'."
(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
@@ -2716,9 +2717,11 @@ This tests also `make-symbolic-link', `file-truename'
and `add-name-to-file'."
(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
@@ -2737,7 +2740,7 @@ This tests also `make-symbolic-link', `file-truename' and
`add-name-to-file'."
(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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 49cd561: * test/lisp/tramp-tests.el (tramp-test21-file-links): Special code for smb.,
Michael Albinus <=