diff --git a/src/channel.c b/src/channel.c index 27aa259e2b..cfbfcb2bec 100644 --- a/src/channel.c +++ b/src/channel.c @@ -5927,6 +5927,9 @@ f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED) channel_T *channel; jobopt_T opt; + if (check_restricted() || check_secure()) + return; + if (in_vim9script() && (check_for_chan_or_job_arg(argvars, 0) == FAIL || check_for_dict_arg(argvars, 1) == FAIL)) diff --git a/src/popupwin.c b/src/popupwin.c index cae19b908d..79ff1b09cc 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -4491,6 +4491,9 @@ f_popup_setoptions(typval_T *argvars, typval_T *rettv UNUSED) int need_redraw = FALSE; int need_reposition = FALSE; + if (check_secure()) + return; + if (in_vim9script() && (check_for_number_arg(argvars, 0) == FAIL || check_for_dict_arg(argvars, 1) == FAIL)) diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 32b2801888..ac394dd2b6 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -2632,8 +2632,9 @@ func Test_popup_opacity_move_after_close() call StopVimInTerminal(buf) endfunc -func Test_popup_create_sandbox() +func Test_popup_sandbox() call assert_fails('sandbox call popup_create("hello", {})', 'E48:') + call assert_fails('sandbox call popup_setoptions(1, {})', 'E48:') endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_restricted.vim b/src/testdir/test_restricted.vim index 21133089ee..1997e20b4f 100644 --- a/src/testdir/test_restricted.vim +++ b/src/testdir/test_restricted.vim @@ -70,6 +70,7 @@ func Test_restricted_mode() if has('channel') call assert_fails("call ch_logfile('Xlog')", 'E145:') call assert_fails("call ch_open('localhost:8765')", 'E145:') + call assert_fails("call ch_setoptions('localhost:8765', {})", 'E145:') endif if has('job') diff --git a/src/version.c b/src/version.c index e35cb0962d..df1311759e 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 608, /**/ 607, /**/