From: Michael Albinus Date: Fri, 30 Jul 2021 09:57:39 +0000 (+0200) Subject: Fix bug#49773 in Tramp X-Git-Tag: emacs-28.0.90~1656 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=245d3e9ffded314a25449f69f844eaf80a89c340;p=emacs.git Fix bug#49773 in Tramp * lisp/net/tramp.el (tramp-handle-find-backup-file-name) (tramp-handle-lock-file, tramp-handle-make-auto-save-file-name): Check security hole only if action is in progress. (Bug#49773) --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 80cdd56c0d8..959a0e74352 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3665,6 +3665,7 @@ User is always nil." #'find-backup-file-name (list filename))) ;; Protect against security hole. (when (and (not tramp-allow-unsafe-temporary-files) + (not backup-inhibited) (file-in-directory-p (car result) temporary-file-directory) (zerop (or (tramp-compat-file-attribute-user-id (file-attributes filename 'integer)) @@ -3885,6 +3886,7 @@ Return nil when there is no lockfile." ;; Protect against security hole. (with-parsed-tramp-file-name file nil (when (and (not tramp-allow-unsafe-temporary-files) + create-lockfiles (file-in-directory-p lockname temporary-file-directory) (zerop (or (tramp-compat-file-attribute-user-id (file-attributes file 'integer)) @@ -5425,6 +5427,7 @@ this file, if that variable is non-nil." (setq result (tramp-run-real-handler #'make-auto-save-file-name nil)) ;; Protect against security hole. (when (and (not tramp-allow-unsafe-temporary-files) + auto-save-default (file-in-directory-p result temporary-file-directory) (zerop (or (tramp-compat-file-attribute-user-id (file-attributes filename 'integer))