]> granicus.if.org Git - vim/commitdiff
patch 8.1.0509: checking cwd not accessible fails for root v8.1.0509
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Nov 2018 20:47:16 +0000 (21:47 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Nov 2018 20:47:16 +0000 (21:47 +0100)
Problem:    Checking cwd not accessible fails for root. (James McCoy)
Solution:   Skip this part of the test for root. (closes #3595)

src/testdir/test_terminal.vim
src/version.c

index 235cd3160c95ab70d8090f4c5ec7205615ce8d20..88cb89e9ba95a28370463bad2e79c04eb5435002 100644 (file)
@@ -490,14 +490,17 @@ func Test_terminal_cwd_failure()
   call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
 
   " Case 3: Directory exists but is not accessible.
-  call mkdir('Xdir', '', '0600')
-  " return early if the directory permissions could not be set properly
-  if getfperm('Xdir')[2] == 'x'
-    call delete('Xdir', 'rf')
-    return
+  " Skip this for root, it will be accessible anyway.
+  if $USER != 'root'
+    call mkdir('XdirNoAccess', '', '0600')
+    " return early if the directory permissions could not be set properly
+    if getfperm('XdirNoAccess')[2] == 'x'
+      call delete('XdirNoAccess', 'rf')
+      return
+    endif
+    call assert_fails("call term_start(&shell, {'cwd': 'XdirNoAccess'})", 'E475:')
+    call delete('XdirNoAccess', 'rf')
   endif
-  call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
-  call delete('Xdir', 'rf')
 endfunc
 
 func Test_terminal_servername()
index 1e66b3ed78a57fe74737e973a92b40f929d3af22..fb8a16dc2de3be1f87605cd0c18508aa2ecb97b4 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    509,
 /**/
     508,
 /**/