Skip to content

Commit 0b38f54

Browse files
committed
patch 8.1.0509: checking cwd not accessible fails for root
Problem: Checking cwd not accessible fails for root. (James McCoy) Solution: Skip this part of the test for root. (closes #3595)
1 parent 0f62cf5 commit 0b38f54

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/testdir/test_terminal.vim

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,17 @@ func Test_terminal_cwd_failure()
490490
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
491491

492492
" Case 3: Directory exists but is not accessible.
493-
call mkdir('Xdir', '', '0600')
494-
" return early if the directory permissions could not be set properly
495-
if getfperm('Xdir')[2] == 'x'
496-
call delete('Xdir', 'rf')
497-
return
493+
" Skip this for root, it will be accessible anyway.
494+
if $USER != 'root'
495+
call mkdir('XdirNoAccess', '', '0600')
496+
" return early if the directory permissions could not be set properly
497+
if getfperm('XdirNoAccess')[2] == 'x'
498+
call delete('XdirNoAccess', 'rf')
499+
return
500+
endif
501+
call assert_fails("call term_start(&shell, {'cwd': 'XdirNoAccess'})", 'E475:')
502+
call delete('XdirNoAccess', 'rf')
498503
endif
499-
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
500-
call delete('Xdir', 'rf')
501504
endfunc
502505

503506
func Test_terminal_servername()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ static char *(features[]) =
792792

793793
static int included_patches[] =
794794
{ /* Add new patch number below this line */
795+
/**/
796+
509,
795797
/**/
796798
508,
797799
/**/

0 commit comments

Comments
 (0)