]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#47625 in dired
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 6 May 2021 11:08:56 +0000 (13:08 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 6 May 2021 11:08:56 +0000 (13:08 +0200)
* lisp/dired-aux.el (dired-create-files): Check, that
`dired-do-symlink' does not create symlinks on different hosts.
(Bug#47625)

lisp/dired-aux.el

index 8fe612fa0b10036383bc43dc7d62d36a11136e43..8fce402c7ad06ddeefe3b54d6cc33520c75801b6 100644 (file)
@@ -1962,6 +1962,11 @@ ESC or `q' to not overwrite any of the remaining files,
                   (file-in-directory-p destname from)
                   (error "Cannot copy `%s' into its subdirectory `%s'"
                          from to)))
+            ;; Check, that `dired-do-symlink' does not create symlinks
+            ;; on different hosts.
+            (when (and (eq file-creator 'make-symbolic-link)
+                       (not (equal (file-remote-p from) (file-remote-p to))))
+             (error "Cannot symlink `%s' to `%s' on another host" from to))
             (condition-case err
                 (progn
                   (funcall file-creator from to dired-overwrite-confirmed)