(cdr x))))
tramp-backup-directory-alist)
backup-directory-alist))
- (uid (tramp-compat-file-attribute-user-id
- (file-attributes filename 'integer)))
result)
(prog1 ;; Run plain `find-backup-file-name'.
(setq result
(tramp-run-real-handler
#'find-backup-file-name (list filename)))
;; Protect against security hole.
- (when (and (natnump uid) (zerop uid)
+ (when (and (not tramp-allow-unsafe-temporary-files)
(file-in-directory-p (car result) temporary-file-directory)
- (not tramp-allow-unsafe-temporary-files)
+ (zerop (or (tramp-compat-file-attribute-user-id
+ (file-attributes filename 'integer))
+ tramp-unknown-id-integer))
(not (with-tramp-connection-property
(tramp-get-process v) "unsafe-temporary-file"
(yes-or-no-p
(auto-save-file-name-transforms
(if (null tramp-auto-save-directory)
auto-save-file-name-transforms))
- (uid (tramp-compat-file-attribute-user-id
- (file-attributes buffer-file-name 'integer)))
+ (filename buffer-file-name)
(buffer-file-name
(if (null tramp-auto-save-directory)
buffer-file-name
(prog1 ;; Run plain `make-auto-save-file-name'.
(setq result (tramp-run-real-handler #'make-auto-save-file-name nil))
;; Protect against security hole.
- (when (and (natnump uid) (zerop uid)
+ (when (and (not tramp-allow-unsafe-temporary-files)
(file-in-directory-p result temporary-file-directory)
- (not tramp-allow-unsafe-temporary-files)
+ (zerop (or (tramp-compat-file-attribute-user-id
+ (file-attributes filename 'integer))
+ tramp-unknown-id-integer))
(not (with-tramp-connection-property
(tramp-get-process v) "unsafe-temporary-file"
(yes-or-no-p