grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Create environment block safely


From: Colin Watson
Subject: Re: [PATCH] Create environment block safely
Date: Fri, 2 Oct 2009 09:53:16 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Oct 01, 2009 at 09:31:55PM -0500, address@hidden wrote:
> On Wed, Sep 30, 2009 at 5:54 PM, Colin Watson <address@hidden> wrote:
> > If grub-editenv create is interrupted, it's theoretically possible for
> > it to create an incomplete block that future grub-editenv calls won't
> > recognise. It would be better for it to atomically create either a
> > complete block or nothing. Any objections?
> 
> Be aware that this may lose security settings.  Write-in-place is also
> different wrt hard links, but it would be pretty odd for that file to
> have additional hard links.

While this would be true for writing files in general, this is
explicitly a "create" operation and so I don't think that matters. We
use different code paths when writing to an existing environment block
file.

> You might also need to check for the alternate name, in case the
> operation failed after writing the new content and unlinking the old
> file, but before renaming the new file.

There is no old file here, or if there is then the user has already
explicitly indicated that they don't care about it. There is no unlink
call in my code (and wouldn't be even if this weren't a create
operation; no need to bother when you're renaming over the top anyway).

-- 
Colin Watson                                       address@hidden




reply via email to

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