From: Michael Albinus <michael.albinus@gmx.de>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: Eli Zaretskii <eliz@gnu.org>, 62260@debbugs.gnu.org
Subject: bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
Date: Thu, 23 Mar 2023 17:26:25 +0100 [thread overview]
Message-ID: <875yaro2mm.fsf@gmx.de> (raw)
In-Reply-To: <87lejpm6vk.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Wed, 22 Mar 2023 11:13:03 +0100")
Manuel Giraud <manuel@ledu-giraud.fr> writes:
> Hi Michael,
Hi Manuel,
> What do you think of the attached patch?
Honestly, I haven't had enough time to review it in detail. My gut
feeling tells me that it looks to complicate and too much hard-coded,
but I will need to review. I hope I could do it next days.
> I think it fixes point 2 and 4 of bug#57395. IMO point 3 (unsafe
> non-root-owned file) is not really solvable in a remote setup: local and
> remote uid can be any numbers.
>
> What I'd like to do then is to work on point 1. For this, my idea is to
> make 'tramp-allow-unsafe-temporary-files' a three states variable with
> the following possible values:
>
> - 'ask (default value): Prompt the user "Autosave file on
> local temporary directory, do you want to continue?"
>
> - nil: auto-save-mode should be disable on this file (same
> behaviour when answering "no" to the prompt)
>
> - t: auto-save-mode is on as usual (same behaviour when
> answering "yes" to the prompt)
Please take into account, that tramp-allow-unsafe-temporary-files is not
only for auto-save files. It is used also for backup and file locks. See
functions tramp-handle-find-backup-file-name, tramp-handle-lock-file and
tramp-handle-make-auto-save-file-name.
For the time being, I have added the possibility to suppress auto-save
for remote files. The Tramp manual says now:
--8<---------------cut here---------------start------------->8---
− Keep auto-save files local. This is already the default
configuration in Emacs, don’t change it. If you want to
disable auto-saving for remote files at all, set
‘remote-file-name-inhibit-auto-save’ to ‘t’, but think about
the consequences!
If you want to disable auto-saving just for selected
connections, for example due to security considerations, use
connection-local variables in order to set
‘buffer-auto-save-file-name’. If you, for example, want to
disable auto-saving for all ‘sudo’ connections, apply the
following code. *Note (emacs)Connection Variables::.
(connection-local-set-profile-variables
'my-auto-save-profile
'((buffer-auto-save-file-name . nil)))
(connection-local-set-profiles
'(:application tramp :protocol "sudo")
'my-auto-save-profile)
--8<---------------cut here---------------end--------------->8---
Pushed to master.
Best regards, Michael.
next prev parent reply other threads:[~2023-03-23 16:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 15:18 bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 15:43 ` Eli Zaretskii
2023-03-18 18:39 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 18:47 ` Eli Zaretskii
2023-03-18 18:51 ` Eli Zaretskii
2023-03-18 19:22 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 20:00 ` Eli Zaretskii
2023-03-18 20:21 ` Eli Zaretskii
2023-03-19 11:43 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-19 12:19 ` Eli Zaretskii
2023-03-19 12:40 ` Michael Albinus
2023-03-19 13:56 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-20 11:41 ` Michael Albinus
2023-03-20 12:22 ` Eli Zaretskii
2023-03-20 12:31 ` Michael Albinus
2023-03-20 14:15 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-19 14:11 ` Eli Zaretskii
2023-03-20 11:43 ` Michael Albinus
2023-03-19 14:18 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-20 11:44 ` Michael Albinus
2023-03-22 10:13 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23 16:26 ` Michael Albinus [this message]
2023-03-24 7:34 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-24 10:35 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-24 17:56 ` Michael Albinus
2023-03-18 19:16 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yaro2mm.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=62260@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=manuel@ledu-giraud.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.