From 5ec4a3dbbc81ef9ed51065189a19689c351e0e8d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 6 May 2021 13:08:56 +0200 Subject: [PATCH] Fix bug#47625 in dired * 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 8fe612fa0b1..8fce402c7ad 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -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) -- 2.39.5