Compare commits

..

8 Commits

Author SHA1 Message Date
Hirohito Higashi
d2dc9a4f37 patch 9.2.0203: Patch v9.2.0185 was wrong
Problem:  Patch v9.2.0185 was wrong
Solution: Revert patch v9.2.0185, root cause fixed in v9.2.0197
          (Hirohito Higashi).

related: #19730
related: #19734
closes:  #19749

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 20:19:07 +00:00
pyllyukko
645ed6597d patch 9.2.0202: [security]: command injection via newline in glob()
Problem:  The glob() function on Unix-like systems does not escape
          newline characters when expanding wildcards. A maliciously
          crafted string containing '\n' can be used as a command
          separator to execute arbitrary shell commands via
          mch_expand_wildcards(). This depends on the user's 'shell'
          setting.
Solution: Add the newline character ('\n') to the SHELL_SPECIAL
          definition to ensure it is properly escaped before being
          passed to the shell (pyllyukko).

closes: #19746

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-w5jw-f54h-x46c

Signed-off-by: pyllyukko <pyllyukko@maimed.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 20:07:51 +00:00
Furkan Sahin
cc8798e719 patch 9.2.0201: filetype: Wireguard config files not recognized
Problem:  filetype: Wireguard config files not recognized
Solution: Detect /etc/wireguard/*.conf files as dosini filetype
          (Furkan Sahin).

closes: #19751

Signed-off-by: Furkan Sahin <furkan-dev@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 19:28:39 +00:00
Foxe Chen
1da42ee271 patch 9.2.0200: term: DECRQM codes are sent too early
Problem:  term: DECRQM codes are sent too early, the resulting DECRPM
          responses can arrive after Vim has already exited, leaking
          into the shell's input buffer (Christian Brabandt).
Solution: Only send DECRQM codes once termcap_active is set
          (Foxe Chen).

related: #19660
fixes:   #19660#issuecomment-4085448070
closes:  #19748

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 19:19:30 +00:00
ichizok
ecf90b92f1 CI: make dependabot monitor .github/actions directory
and also set `cooldown`, `groups`

related: #19747
closes:  #19756

Signed-off-by: Ozaki Kiichi <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 19:04:44 +00:00
Christian Brabandt
7aca0e14de patch 9.2.0199: tests: test_startup.vim fails
Problem:  tests: test_startup.vim fails, because the command line is
          getting too long so that the shell prompt line get shifted by one
          additional screen line down (after v9.2.0194).
Solution: Partly revert Patch v9.2.0194 and do not set termresize and
          termsync options.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-19 18:54:09 +00:00
Christian Brabandt
2f5fe8827e patch 9.2.0198: cscope: can escape from restricted mode
Problem:  cscope: can escape from restricted mode (pyllyukko)
Solution: Disallow :cscope in restricted mode (like :grep),
          add a tests for restricted mode using :grep and :cscope

closes: #19731

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-18 21:29:13 +00:00
Barrett Ruth
faad250544 runtime(doc): Fix typo in if_pyth.txt
closes: #19733

Signed-off-by: Barrett Ruth <br.barrettruth@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-18 21:22:46 +00:00
14 changed files with 103 additions and 25 deletions

View File

@@ -1,8 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
directories:
- "/"
- "/.github/actions/**/*"
schedule:
interval: "weekly"
commit-message:
prefix: "CI"
cooldown:
default-days: 7
groups:
github-actions:
patterns:
- "*"

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 9.2. Last change: 2026 Feb 14
*if_pyth.txt* For Vim version 9.2. Last change: 2026 Mar 18
VIM REFERENCE MANUAL by Paul Moore
@@ -186,7 +186,7 @@ vim.eval(str) *python-eval*
- a list if the Vim expression evaluates to a Vim |list|
- a tuple if the Vim expression evaluates to a Vim |tuple|
- a dictionary if the Vim expression evaluates to a Vim |dict|
- a boolean if Vim exression evaluates to |v:true| or |v:false|
- a boolean if Vim expression evaluates to |v:true| or |v:false|
- `None` if Vim expression evaluates to |v:null| or |v:none|
Dictionaries, lists and tuples are recursively expanded.
Examples: >

View File

@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.2. Last change: 2026 Mar 17
*version9.txt* For Vim version 9.2. Last change: 2026 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -52600,6 +52600,8 @@ Restricted mode~
Using external diff mode or setting environment variables is no longer allowed
when Vim is running in |restricted-mode|.
Using |:cscope| is no longer allowed.
Other ~
-----
- The new |xdg.vim| script for full XDG compatibility is included.

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2026 Feb 18
" Last Change: 2026 Mar 19
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If the filetype can be detected from extension or file name(the final path component),
@@ -1571,6 +1571,9 @@ au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')
" Subversion commit file
au BufNewFile,BufRead svn-commit*.tmp setf svn
" Wireguard config
au BufNewFile,BufRead */etc/wireguard/*.conf setf dosini
" X resources file
au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')

View File

@@ -254,6 +254,9 @@ do_cscope_general(
{
cscmd_T *cmdp;
if (check_restricted())
return;
if ((cmdp = cs_lookup_cmd(eap)) == NULL)
{
cs_help(eap);

View File

@@ -893,6 +893,9 @@ vim_main2(void)
may_req_bg_color();
# endif
// Same reason for termresponse, don't want the terminal sending out the
// DECRPM response after Vim has exited.
send_decrqm_modes();
// start in insert mode
if (p_im)

View File

@@ -7075,7 +7075,7 @@ mch_expandpath(
# define SEEK_END 2
# endif
# define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|"
# define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|\n"
int
mch_expand_wildcards(

View File

@@ -96,6 +96,7 @@ void swap_tcap(void);
void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
int term_replace_keycodes(char_u *ta_buf, int ta_len, int len_arg);
void send_decrqm_modes(void);
void term_disable_dec(void);
void term_set_win_resize(bool state);
void term_set_sync_output(int flags);

View File

@@ -1451,9 +1451,6 @@ win_redr_custom(
if (wp == NULL)
{
// Fill the TabPageIdxs[] array for clicking in the tab pagesline.
int end_col = firstwin->w_wincol + topframe->fr_width;
if (end_col > Columns)
end_col = Columns;
col = firstwin->w_wincol;
len = 0;
p = buf;
@@ -1461,14 +1458,12 @@ win_redr_custom(
for (n = 0; tabtab[n].start != NULL; n++)
{
len += vim_strnsize(p, (int)(tabtab[n].start - p));
while (col < len && col < end_col)
while (col < len)
TabPageIdxs[col++] = fillchar;
if (col >= end_col)
break;
p = tabtab[n].start;
fillchar = tabtab[n].userhl;
}
while (col < end_col)
while (col < firstwin->w_wincol + topframe->fr_width)
TabPageIdxs[col++] = fillchar;
}

View File

@@ -4051,16 +4051,6 @@ starttermcap(void)
out_str(T_FE);
#endif
if (cur_tmode == TMODE_RAW)
{
// Request setting of relevant DEC modes via DECRQM
for (int i = 0; i < (int)ARRAY_LENGTH(dec_modes); i++)
{
vim_snprintf((char *)IObuff, IOSIZE, "\033[?%d$p", dec_modes[i]);
out_str(IObuff);
}
}
out_flush();
termcap_active = TRUE;
screen_start(); // don't know where cursor is now
@@ -7981,6 +7971,23 @@ term_replace_keycodes(char_u *ta_buf, int ta_len, int len_arg)
return len;
}
/*
* Query the settings for the DEC modes we support
*/
void
send_decrqm_modes(void)
{
if (termcap_active && cur_tmode == TMODE_RAW)
{
// Request setting of relevant DEC modes via DECRQM
for (int i = 0; i < (int)ARRAY_LENGTH(dec_modes); i++)
{
vim_snprintf((char *)IObuff, IOSIZE, "\033[?%d$p", dec_modes[i]);
out_str(IObuff);
}
}
}
/*
* Should be called when cleaning up terminal state.
*/

View File

@@ -256,6 +256,7 @@ def s:GetFilenameChecks(): dict<list<string>>
'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf',
'any/.local/share/flatpak/repo/config',
'.alsoftrc', 'alsoft.conf', 'alsoft.ini', 'alsoftrc.sample',
'/etc/wireguard/wg0.conf',
'.notmuch-config', '.notmuch-config.myprofile',
'~/.config/notmuch/myprofile/config'] + WhenConfigHome('$XDG_CONFIG_HOME/notmuch/myprofile/config'),
dot: ['file.dot', 'file.gv'],

View File

@@ -176,4 +176,48 @@ func Test_restricted_env()
call delete('XResult_env')
endfunc
func Test_restricted_grep()
CheckScreendump
let lines =<< trim END
let result = 'okay'
try
" Try to use grep to execute an external command
grep 'Vim' ./*.vim
catch /^Vim\%((\S\+)\)\=:E145:/
let result = 'grep-blocked'
endtry
call writefile([result], 'XResult_grep')
qa!
END
call writefile(lines, 'Xrestricted_grep', 'D')
if RunVim([], [], '-Z --clean -S Xrestricted_grep')
call assert_equal(['grep-blocked'], readfile('XResult_grep'))
endif
call delete('XResult_grep')
endfunc
func Test_restricted_cscope()
CheckFeature cscope
" File does not exist, but shouldn't matter, it must be disallowed
let lines =<< trim END
let result = 'okay'
try
cscope add Xfoobar.out
catch /^Vim\%((\S\+)\)\=:E145:/
let result = 'blocked'
endtry
call writefile([result], 'XResult_cscope')
qa!
END
call writefile(lines, 'Xrestricted_cscope', 'D')
if RunVim([], [], '-Z --clean -S Xrestricted_cscope')
call assert_equal(['blocked'], readfile('XResult_cscope'))
endif
call delete('XResult_cscope')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -844,8 +844,7 @@ func Test_stdin_no_newline()
call term_sendkeys(buf, "echo hello > temp.txt\<CR>")
call TermWait(buf, 200)
call term_sendkeys(buf, "bash -c '../vim --cmd \"set trz=sigwinch notsy\"'
\ ' --not-a-term -u NONE -c \":q!\" -' < temp.txt\<CR>")
call term_sendkeys(buf, "bash -c '../vim --not-a-term -u NONE -c \":q!\" -' < temp.txt\<CR>")
call TermWait(buf, 200)
" Capture terminal output

View File

@@ -734,6 +734,18 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
203,
/**/
202,
/**/
201,
/**/
200,
/**/
199,
/**/
198,
/**/
197,
/**/