Hi Bram,

On Sat, Nov 4, 2017 at 1:35 PM, Bram Moolenaar <[email protected]> wrote:
>
> Patch 8.0.1263
> Problem:    Others can read the swap file if a user is careless with his
>             primary group.
> Solution:   If the group permission allows for reading but the world
>             permissions doesn't, make sure the group is right.
> Files:      src/fileio.c, src/testdir/test_swap.vim, src/Makefile
>

Any reason why the Test_swap_directory() function is commented out by
this patch?

Thanks,
Yegappan

>
>
> *** ../vim-8.0.1262/src/testdir/test_swap.vim   2017-11-02 21:04:17.987345075 
> +0100
> --- src/testdir/test_swap.vim   2017-11-04 21:28:36.607992132 +0100
> ***************
> *** 1,48 ****
>   " Tests for the swap feature
>
> ! " Tests for 'directory' option.
> ! func Test_swap_directory()
>     if !has("unix")
>       return
>     endif
> !   let content = ['start of testfile',
> !             \ 'line 2 Abcdefghij',
> !             \ 'line 3 Abcdefghij',
> !             \ 'end of testfile']
> !   call writefile(content, 'Xtest1')
> !
> !   "  '.', swap file in the same directory as file
> !   set dir=.,~
> !
> !   " Verify that the swap file doesn't exist in the current directory
> !   call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1))
> !   edit Xtest1
> !   let swfname = split(execute("swapname"))[0]
> !   call assert_equal([swfname], glob(swfname, 1, 1, 1))
> !
> !   " './dir', swap file in a directory relative to the file
> !   set dir=./Xtest2,.,~
> !
> !   call mkdir("Xtest2")
> !   edit Xtest1
> !   call assert_equal([], glob(swfname, 1, 1, 1))
> !   let swfname = "Xtest2/Xtest1.swp"
> !   call assert_equal(swfname, split(execute("swapname"))[0])
> !   call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1))
>
> !   " 'dir', swap file in directory relative to the current dir
> !   set dir=Xtest.je,~
>
> !   call mkdir("Xtest.je")
> !   call writefile(content, 'Xtest2/Xtest3')
> !   edit Xtest2/Xtest3
> !   call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1))
> !   let swfname = "Xtest.je/Xtest3.swp"
> !   call assert_equal(swfname, split(execute("swapname"))[0])
> !   call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1))
>
> !   set dir&
> !   call delete("Xtest1")
> !   call delete("Xtest2", "rf")
> !   call delete("Xtest.je", "rf")
>   endfunc
> --- 1,82 ----
>   " Tests for the swap feature
>
> ! "" Tests for 'directory' option.
> ! "func Test_swap_directory()
> ! "  if !has("unix")
> ! "    return
> ! "  endif
> ! "  let content = ['start of testfile',
> ! "           \ 'line 2 Abcdefghij',
> ! "           \ 'line 3 Abcdefghij',
> ! "           \ 'end of testfile']
> ! "  call writefile(content, 'Xtest1')
> ! "
> ! "  "  '.', swap file in the same directory as file
> ! "  set dir=.,~
> ! "
> ! "  " Verify that the swap file doesn't exist in the current directory
> ! "  call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1))
> ! "  edit Xtest1
> ! "  let swfname = split(execute("swapname"))[0]
> ! "  call assert_equal([swfname], glob(swfname, 1, 1, 1))
> ! "
> ! "  " './dir', swap file in a directory relative to the file
> ! "  set dir=./Xtest2,.,~
> ! "
> ! "  call mkdir("Xtest2")
> ! "  edit Xtest1
> ! "  call assert_equal([], glob(swfname, 1, 1, 1))
> ! "  let swfname = "Xtest2/Xtest1.swp"
> ! "  call assert_equal(swfname, split(execute("swapname"))[0])
> ! "  call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1))
> ! "
> ! "  " 'dir', swap file in directory relative to the current dir
> ! "  set dir=Xtest.je,~
> ! "
> ! "  call mkdir("Xtest.je")
> ! "  call writefile(content, 'Xtest2/Xtest3')
> ! "  edit Xtest2/Xtest3
> ! "  call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1))
> ! "  let swfname = "Xtest.je/Xtest3.swp"
> ! "  call assert_equal(swfname, split(execute("swapname"))[0])
> ! "  call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1))
> ! "
> ! "  set dir&
> ! "  call delete("Xtest1")
> ! "  call delete("Xtest2", "rf")
> ! "  call delete("Xtest.je", "rf")
> ! "endfunc
> !
> ! func Test_swap_group()
>     if !has("unix")
>       return

-- 
-- 
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