Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove -Z ("restricted" mode) #11972

Closed
justinmk opened this issue Mar 2, 2020 · 3 comments
Closed

remove -Z ("restricted" mode) #11972

justinmk opened this issue Mar 2, 2020 · 3 comments
Labels
compatibility compatibility with Vim or older Neovim complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md refactor changes that are not features or bugfixes
Milestone

Comments

@justinmk
Copy link
Member

justinmk commented Mar 2, 2020

Followup to #11929 (comment) :

-Z is a fake-secure mode that behaves slightly differently than "sandbox" mode. It sprinkles more whack-a-mole "secure" code in various places.

Does anyone actually use -Z? Where/why is it useful?

It's fragile to expect applications like N/Vim to plug all potential vectors for eval/shell/etc. For secure scenarios, OS permissions should be used instead.

@justinmk justinmk added refactor changes that are not features or bugfixes compatibility compatibility with Vim or older Neovim complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md labels Mar 2, 2020
@justinmk justinmk added this to the todo milestone Mar 2, 2020
georg3tom added a commit to georg3tom/neovim that referenced this issue Mar 8, 2020
@bfredl bfredl closed this as completed in 7777532 Nov 11, 2020
bfredl added a commit that referenced this issue Nov 11, 2020
@bfredl bfredl modified the milestones: backlog, 0.5 Nov 11, 2020
@dstein64
Copy link
Contributor

dstein64 commented Jan 10, 2021

"Does anyone actually use -Z? Where/why is it useful?"

One use case is for vimgolf, where -Z is passed to the vim command. As is, removing -Z breaks vimgolf for users using GOLFVIM=nvim. Presumably a high proportion of vimgolf users, including those who use Neovim as their primary editor, do not change GOLFVIM—from its default vim—to nvim. However, the existence of vimgolf PRs* related to Neovim compatibility suggests that there will be users affected by this change (unless vimgolf is updated to accommodate).

@bfredl
Copy link
Member

bfredl commented Jan 10, 2021

@dstein64 does vimgolf rely anything allowed in restricted mode but disabled in the sandbox? because otherwise it could use the sandbox (I don't like sandbox either, but we won't do anything about it except doc updates possibly for 0.5)

@dstein64
Copy link
Contributor

The documentation for sandbox says that "changing the buffer text" is not allowed in the sandbox, which would be a problem if the sandbox is used generally, and not just for normal mode commands.

vimgolf runs locally on users' computers, launching Vim with the -W option to record keystrokes. A few additional options, like -Z and --noplugin are passed so that solutions can only use pure Vim, as opposed to relying on external functionality or plugins. The keystrokes are then sent to the Vimgolf server for submission to the leaderboard.

In case the sandbox would be feasible, is there some way to run Neovim such that all commands are run through the sandbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility compatibility with Vim or older Neovim complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md refactor changes that are not features or bugfixes
Projects
None yet
Development

No branches or pull requests

3 participants