Skip to content

Commit

Permalink
patch 8.0.0887: can create a logfile in the sandbox
Browse files Browse the repository at this point in the history
Problem:    Can create a logfile in the sandbox.
Solution:   Disable ch_logfile() in the sandbox. (Yasuhiro Matsumoto)
  • Loading branch information
brammool committed Aug 7, 2017
1 parent f8d57a5 commit 6d87e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/evalfunc.c
Expand Up @@ -1930,6 +1930,9 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
char_u *opt = (char_u *)""; char_u *opt = (char_u *)"";
char_u buf[NUMBUFLEN]; char_u buf[NUMBUFLEN];


/* Don't open a file in restricted mode. */
if (check_restricted() || check_secure())
return;
fname = get_tv_string(&argvars[0]); fname = get_tv_string(&argvars[0]);
if (argvars[1].v_type == VAR_STRING) if (argvars[1].v_type == VAR_STRING)
opt = get_tv_string_buf(&argvars[1], buf); opt = get_tv_string_buf(&argvars[1], buf);
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -769,6 +769,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
887,
/**/ /**/
886, 886,
/**/ /**/
Expand Down

0 comments on commit 6d87e9e

Please sign in to comment.