1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-04-01 23:46:45 +02:00
Commit graph

10 commits

Author SHA1 Message Date
Konfekt
7c3f9af0ed
runtime(misc): unset compiler in various ftplugins
just to foster best practices

closes: 

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 17:26:46 +02:00
Tiseno
d1d9316c66
runtime(zig): refactor zig ftplugin, remove auto format
Refactored zig ftplugin, removed upstream comment, aucmd and
auto formatting support. Updated documentation for zig configuration
settings and added new maintainer.

closes: 

Signed-off-by: Tiseno <mathias.lindgren@stabelo.se>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-21 23:27:03 +02:00
D. Ben Knoble
cd8a3eaf53
runtime(dist): centralize safe executable check and add vim library ()
Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes,
2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when
loading ftplugins, 2023-09-06).

This puts the logic for safe executable checks in a single place, by introducing
a central vim library, so all filetypes benefit from consistency.

Notable changes:
- dist#vim because the (autoload) namespace for a new runtime support
  library. Supporting functions should get documentation. It might make
  life easier for NeoVim devs to make the documentation a new file
  rather than cram it into existing files, though we may want
  cross-references to it somewhere…
- The gzip and zip plugins need to be opted into by enabling execution
  of those programs (or the global plugin_exec). This needs
  documentation or discussion.
- This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed
  in f7ac0ef50 (runtime: don't execute external commands when loading
  ftplugins, 2023-09-06), but the variable was still referenced. Since
  the new function takes care of that automatically, the variable is no
  longer needed.

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-04 10:11:17 +01:00
Gregory Anders
e08bfef88b
runtime(zig): Update Zig runtime files ()
Update runtime files from upstream (https://github.com/zig/zig.vim) at
commit 54c216e5306a5c3878a60596aacb94dca8652ab9.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-19 17:16:59 +02:00
Christian Brabandt
ee17b6f70d
patch 9.0.1886: Various Typos
Problem:  Various Typos
Solution: Fix Typos

This is a collection of typo related commits.

closes: 
closes: 

Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-09 11:31:38 +02:00
Christian Brabandt
f7ac0ef509
runtime: don't execute external commands when loading ftplugins
This is a followup to 816fbcc262 (patch
9.0.1833: [security] runtime file fixes)

It basically disables that external commands are run on loading of the
filetype plugin, **unless** the user has set the `g:plugin_exec = 1`
global variable in their configuration or for a specific filetype the
variable g:<filetype>_exec=1.

There are a few more plugins, that may execute system commands like
debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least
do not run those commands by default during loading of the filetype plugin
(there the command is mostly run as convenience for auto-completion or
to provide documentation lookup).

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <vim@tpope.org>
2023-09-06 20:41:25 +02:00
Anton Sharonov
67c951df4c
runtime(ftplugin): allow to exec if curdir is in PATH
In case the current directory is present as valid $PATH entry, it is OK
to call the program from it, even if vim curdir is in that same
directory.

(Without that patch, for instance, you will not be able to open .zip
files while your current directory is /bin)

closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-05 21:04:44 +02:00
Christian Brabandt
816fbcc262
patch 9.0.1833: [security] runtime file fixes
Problem:  runtime files may execute code in current dir
Solution: only execute, if not run from current directory

The perl, zig and ruby filetype plugins and the zip and gzip autoload
plugins may try to load malicious executable files from the current
working directory.  This is especially a problem on windows, where the
current directory is implicitly in your $PATH and windows may even run a
file with the extension `.bat` because of $PATHEXT.

So make sure that we are not trying to execute a file from the current
directory. If this would be the case, error out (for the zip and gzip)
plugins or silently do not run those commands (for the ftplugins).

This assumes, that only the current working directory is bad. For all
other directories, it is assumed that those directories were
intentionally set to the $PATH by the user.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-31 23:52:30 +02:00
Viktor Szépe
3fc7a7e44a
runtime: Fix typos in various files
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
2023-08-23 21:20:00 +02:00
Bram Moolenaar
86b4816766 Update runtime files 2022-12-06 18:20:10 +00:00