]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#49773 in Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 30 Jul 2021 09:57:39 +0000 (11:57 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 30 Jul 2021 09:57:39 +0000 (11:57 +0200)
* 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)

lisp/net/tramp.el

index 80cdd56c0d84d8181d2db95876c87d04ee199bca..959a0e74352ca605dd5b5871175c0710994a7640 100644 (file)
@@ -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))