On Wed, Nov 08, 2017 at 10:15:31PM +0100, Bram Moolenaar wrote:
>>> Can you write a test for this?
>>
>> I don't know how. It's a race condition which is difficult to
>> reproduce (file must not exist during mch_stat, but exist during
>> mch_open).
>
> I think you can simulate this by creating the viminfo.tmp file with no
> access for the current user.  Then mch_stat() fails but creating the
> file also fails.

This won't work. Stating a file succeeds even without read
access. Preventing write access to the directory would work for
the first part (mch_stat and mch_open fail) but then the rename
step would fail.

Regards
Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui