bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18811: 25.0.50; Saving or visitting files with ".gpg" extension


From: Dani Moncayo
Subject: bug#18811: 25.0.50; Saving or visitting files with ".gpg" extension
Date: Mon, 3 Nov 2014 17:02:26 +0100

On Mon, Nov 3, 2014 at 3:57 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>>> emacs -Q
>>>> C-x C-w f . g p g RET
>>>> The file is not saved.  Generated Messages:
>>>> Saving file c:/mingw/bin/f.gpg...
>>>> Opening output file: Searching for program, no such file or directory, gpg
>>> What behavior did you expect?
>> See below.
>
> The .gpg extension is normally used for encrypted files, so C-x C-w
> foo.gpg RET *should* either encrypt the file or signal an error.
> Saving the file in plain text would be a major security error, I think.
>
> When visiting a .gpg file it would be acceptable to open it as "plain
> text" and show the corresponding binary "garbage", but I'm not sure how
> useful that would be.  You can always use `find-file-literally' for that.
>
>> I didn't know about that mode, but yes, I don't think it is reasonable
>> to have that mode enabled when it will certainly fail (preventing the
>> user from visiting/saving a file/buffer).
>
> I guess for writing purposes, we could offer a write-file-literally command.
> But I think it's best not to enable/disable auto-encryption-mode based
> on the presence of `gpg', since there'd the be the risk that the user
> saves a file as foo.gpg expecting it to be encrypted and then be very
> disappointed later on to discover that for some reason Emacs failed to
> find `gpg' at that time and just saved it in plain text instead.
>
> As for whether it should be enabled or disabled by default, we've had it
> enabled for a long time with almost no complaints so far (other than
> yours, obviously), so I think it's a good default.

Well, I actually hit this problem by accident, because I stored the
output of "gpg --export --armor my_key_id" in a file with .gpg
extension.

It was a surprise for me not being able to visit that file from Emacs,
but IIUC, I chose a *bad* extension for the file, and I could have
visited my file just disabling auto-encryption-mode.

So, I think this bug report can be closed.

Thank you.

-- 
Dani Moncayo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]