[Top][All Lists]

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

Re: [bug #46481] install-info can "corrupt" dir file if interrupted.

From: Assaf Gordon
Subject: Re: [bug #46481] install-info can "corrupt" dir file if interrupted.
Date: Fri, 20 Nov 2015 19:47:12 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


Regarding a 'safer' way to replace files during installation:

On 11/20/2015 06:22 PM, Gavin Smith wrote:
On 20 November 2015 at 22:53, Karl Berry <address@hidden> wrote:
3) all that said, writing to a temp file and renaming is at least
viable, although rather a pain and susceptible to many hard-to-pin-down

That's my worry too. How do we know that there's not some other way to
make it fail by abusing the program? What if you turn the power off to
your computer as the operating system is renaming the file? And so on.

Eric Blake (CC'd) recently mentioned on the GNU coreutils mailing list the 
'renameat2' syscall
and was looking for possible use-cases of its new atomic file-swap ability:

This could be such a case: install everything to a temp location,
then atomically swap the temp/real files, then (if the swap succeeded), delete 
the (now old) temp files.

just a thought...
 - assaf

reply via email to

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