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

James Vega jamessan at debian.org
Sat Jul 18 15:50:23 UTC 2009


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.

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.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20090718/4b3775bc/attachment.pgp>


More information about the pkg-vim-maintainers mailing list