Bug#537299: base: user deletes files without write permission, partition full

James Vega jamessan at debian.org
Tue Oct 27 18:35:58 UTC 2009


tag 537299 moreinfo unreproducible
thanks

On Sat, Jul 18, 2009 at 11:50 AM, James Vega <jamessan at debian.org> wrote:
> On Thu, Jul 16, 2009 at 06:20:25PM -0400, Michael S. Gilbert wrote:
>> On Thu, 16 Jul 2009 23:26:26 +0200, Chiel Kooijman wrote:
>> > Thanks for your reply,
>> >
>> > I guess you're right.
>> > It hadn't occurred to me yet that it could have happened at the moment of
>> > opening the second time when I did have writing permission.
>> >
>> > So this is indeed probably not a security problem.
>>
>> reassigning to vim.  it's likely a corner case that's difficult and
>> just not interesting to deal with (user's should know that lack of
>> disk space often leads to unexpected badness). but you can see what they
>> have to say about it.
>
> There appears to be two problems here.
>
> First, the "Unable to create a swapfile, recovery will be impossible!"
> message didn't require any user interaction to dismiss.  Although
> there's a chance this wasn't displayed (swapfiles disabled, swapfile
> created on different non-full partition), it should definitely require
> the user to dismiss the message when it does occur.

I'm not as sure about this as I seem to have been when I sent the last
mail.  There are various reasons that a swapfile might not be created
and the presence (or lack thereof) doesn't help in the given scenario.
That is, writing out the blank buffer and then exiting Vim means the
swapfile, if one was created, has been deleted.

> Second, the user should not have been presented with a blank buffer
> which they could save, thus destroying the original file.  Whatever
> error condition caused the blank buffer to be displayed should also flag
> the buffer as read-only.  The only other time I've seen a blank buffer
> when the file wasn't empty is when trying to load a multi-GB file in Vim
> and interrupting the load process with ^C.
>
> I have been able to reproduce this scenario and it looks like Vim either
> isn't handling or is mishandling the ENOSPC error condition when it
> tries to create the swapfile which somehow leads to presenting a blank
> buffer to the user.

Trying this again in a more appropriate environment (VM instead of an
lvm snapshot), I'm unable to reproduce the blank buffer.  I get the
"Unable to create a swapfile" message, but then the buffer correctly
displays the file.

My previous "success" with reproducing the problem was probably related
to the way everything fails when using an lvm snapshot smaller than the
base volume and exceeding the capacity of the snapshot.

Any extra information on how to reproduce the actual problem would be
appreciated.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at debian.org>





More information about the pkg-vim-maintainers mailing list