GNU bug report logs - #62260
30.0.50; [PATCH] Restrict auto-save file mode

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Sat, 18 Mar 2023 15:19:01 UTC

Severity: normal

Tags: patch

Merged with 57395

Found in versions 28.1, 30.0.50

Full log


Message #32 received at 62260 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62260 <at> debbugs.gnu.org
Subject: Re: bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
Date: Sun, 19 Mar 2023 12:43:02 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Cc: 62260 <at> debbugs.gnu.org
>> Date: Sat, 18 Mar 2023 22:00:32 +0200
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> 
>> > With this patch, the /tmp directory now contains an auto-save file with
>> > mode 0600.
>> 
>> When a buffer visits a file, its auto-save file should have the same
>> mode bits as the file itself (modulo your umask).  I see no need to
>> affect that part in any case.  If the file itself is not private, why
>> should its auto-save file be private?  Also, there's
>> auto-save-visited-mode.
>
> More generally: what problems are you trying to solve here?  If this
> code causes some problems, please describe them, and let's see whether
> and how we should fix them.

You're right.  I should have start from here.  So it all start with a
recurring message I get from TRAMP whenever I access a root file (via
sudo method) for the first time.  It asks:

  "Autosave file on local temporary directory, do you want to continue?"

I answer "yes" but it seems that it can potentially leak root data
through auto-save files.  Looking at the code that asks this question
(tramp.el:6528), I see that I can set
'tramp-allow-unsafe-temporary-files' to t and I won't see the question
again... but the leakage is still possible.  So I guess what I want is
an option to stop auto-save entirely in those cases.

From there, I've looked at how auto-save work and I ask myself: "maybe
instead of such an option, I could limit others rights on auto-save
files".  And that's how I came up with this patch.
-- 
Manuel Giraud




This bug report was last modified 2 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.