diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-07 20:51:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-07 20:51:51 +0200 |
commit | 6d87e9e1c6a580609d48d4aa54a20b26b10c5b77 (patch) | |
tree | 4ef597c215c35dc0d9a22ab4e79e23ddc258fc3d | |
parent | f8d57a50496d854f3e82725bfde1543c9d01ff98 (diff) | |
download | vim-git-6d87e9e1c6a580609d48d4aa54a20b26b10c5b77.tar.gz |
patch 8.0.0887: can create a logfile in the sandboxv8.0.0887
Problem: Can create a logfile in the sandbox.
Solution: Disable ch_logfile() in the sandbox. (Yasuhiro Matsumoto)
-rw-r--r-- | src/evalfunc.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 2377d1957..0703b44f1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1930,6 +1930,9 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED) char_u *opt = (char_u *)""; char_u buf[NUMBUFLEN]; + /* Don't open a file in restricted mode. */ + if (check_restricted() || check_secure()) + return; fname = get_tv_string(&argvars[0]); if (argvars[1].v_type == VAR_STRING) opt = get_tv_string_buf(&argvars[1], buf); diff --git a/src/version.c b/src/version.c index 4e78e31a2..29703ed71 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 887, +/**/ 886, /**/ 885, |