nano-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] files: improve the backup procedure to ensure no data is los


From: Benno Schulenberg
Subject: Re: [PATCH] files: improve the backup procedure to ensure no data is lost
Date: Wed, 1 Jul 2020 09:44:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Op 30-06-2020 om 16:42 schreef Benno Schulenberg:
> From: Michalis Kokologiannakis <mixaskok@gmail.com>
> 
> The backup is made either by renaming the original file, or,
> in case renaming fails, by copying it.

There's at least one problem with renaming the original file to
create a backup.  It means that when the buffer gets written out
to a new file, this new file is owned by the current user, and
if that user is not the same as the original owner...  Also, if
the file is edited by root, who has (at least on my machine) a
umask of 0022, it means the file has become unwritable for the
original owner.  :|

So... I think we should skip the fastpath and just always copy
the current file to create a backup.  Or at least skip the
fastpath when the current user is not the owner of the file.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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