Commit Graph

8 Commits

Author SHA1 Message Date
thinca 868ad62cb8 patch 9.2.0568: pythoncomplete: g:pythoncomplete_allow_import had no effect
Problem:  The security patch 9.2.0561 added a vim.eval() call inside
          Completer.evalsource() to honor g:pythoncomplete_allow_import.
          But the 'vim' module is only imported inside the outer
          vimcomplete() / vimpy3complete() function, not at the script's
          top level, so referring to it from a Completer method raises
          NameError.  The surrounding bare 'except' silently swallows
          the error and leaves allow_imports at 0, meaning the opt-in
          never takes effect -- 'import os' (and any other
          buffer-level import) is always skipped, no candidates are
          produced for 'os.<...>' and
          Test_popup_and_preview_autocommand() fails on the Windows
          CI matrix (Linux skips the test because Python 2 is absent).
Solution: Re-import 'vim' at the top of evalsource() in both
          pythoncomplete.vim and python3complete.vim so the eval reads
          the global, and set g:pythoncomplete_allow_import = 1 in the
          test (it is the opt-in intended for callers that trust the
          buffer contents) (thinca).

closes: #20386

Signed-off-by: thinca <thinca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-31 12:33:07 +00:00
Christian Brabandt 4b850457e1 patch 9.2.0561: [security]: possible code execution with python3complete
Problem:  [security]: possible code execution with python3complete
Solution: Disable execution of import/from statements

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-52mc-rq6p-rc7c

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-29 19:08:20 +00:00
Mao-Yining 27630b28ad runtime(python3complete): remove trailing white space
related: #19354

Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-02-07 15:30:19 +00:00
Bram Moolenaar 46eea444d9 Update runtime files 2022-03-30 10:51:39 +01:00
Bram Moolenaar 6c391a74fe Update runtime files 2021-09-09 21:55:11 +02:00
Bram Moolenaar 4f4d51a942 Update runtime files. 2020-10-11 13:57:40 +02:00
Bram Moolenaar ca63501fbc Update various runtime files. 2015-09-25 20:34:21 +02:00
Bram Moolenaar bd5e15fd5c Added support for Python 3. (Roland Puntaier) 2010-07-17 21:19:38 +02:00