summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-rclone.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-07-12 15:10:57 +0200
committerMichael Albinus <michael.albinus@gmx.de>2019-07-12 15:10:57 +0200
commit955db220053778bd1e47ff9daf87896b7fd52a67 (patch)
treed7e7b138ee69930467f6eb40e6d211c3521c2ac3 /lisp/net/tramp-rclone.el
parent9f76913184c900534fa17311ff5b1af747ff6264 (diff)
downloademacs-955db220053778bd1e47ff9daf87896b7fd52a67.tar.gz
Check directory in Tramp's {copy,rename}-file
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file) (tramp-smb-handle-rename-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file): Check, that NEWNAME is not a directory given as file name. * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Extend tests.
Diffstat (limited to 'lisp/net/tramp-rclone.el')
-rw-r--r--lisp/net/tramp-rclone.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 22a8ca3ac6c..9b3eab34771 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -215,6 +215,8 @@ file names."
(with-parsed-tramp-file-name (if t1 filename newname) nil
(when (and (not ok-if-already-exists) (file-exists-p newname))
(tramp-error v 'file-already-exists newname))
+ (when (and (file-directory-p newname) (not (directory-name-p newname)))
+ (tramp-error v 'file-error "File is a directory %s" newname))
(if (or (and t1 (not (tramp-rclone-file-name-p filename)))
(and t2 (not (tramp-rclone-file-name-p newname))))