Found this when dealing with a "creative" FUSE filesystem.  The fuse
filesystem will assume that everything exists and is a directory, so
stat works, cd and file creation do not.  The fuse filesystem is clearly
bad, but that is not the point.

Vim will try to mkdir "$TMPDIR/v4sgqHU".  If TMPDIR exists in your
environment, it will mkdir "/tmp/v4sgqHU" or whatever you have set it
to.  If it doesn't exist, it will literally mkdir "$TMPDIR/v4sgqHU".

In most sane environments "$TMPDIR" doesn't exist as vim works just
fine.  Something like:
stat("$TMPDIR", 0x7fffc90aad60)         = -1 ENOENT (No such file or directory)
stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=5620, ...}) = 0
mkdir("/tmp/v3C11LF", 0700)             = 0

In my insane fuse environment instead:
stat("$TMPDIR", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
gettimeofday({1430937134, 707649}, NULL) = 0
mkdir("$TMPDIR/v4sgqHU", 0700) = -1 EEXIST (File exists)
mkdir("$TMPDIR/vvuiqHU", 0700) = -1 EEXIST (File exists)
mkdir("$TMPDIR/vWvkqHU", 0700) = -1 EEXIST (File exists)
...

After about 30s and 250k attempts vim aborts and uses /tmp instead.

The vim bug is to try "$TMPDIR" even though the environment variable
isn't set.  Arguably that could become a security-issue if I can create
a "$TMPDIR" in a directory I control and trick someone else to open a
file from that directory.  So independently of what praise you might
want to heap on my fuse-thing, vim is equally at fault here.

Jörn

--
The key to performance is elegance, not battalions of special cases.
-- Jon Bentley and Doug McIlroy

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui