goneovim
goneovim copied to clipboard
Modeline triggers E12 security errors
Create a .txt file somewhere with contents like this:
# vim: tw=80 lbr spell
Editing this file in GoNeovim 0.4.7 will cause three errors, one for each modeline setting.
Editing this file in GoNeovim (:e ~/path/to/test.txt
) generates the following errors:
Error detected while processing OptionSet Autocommands for "*":
E12: Command not allowed from exrc/vimrc in current dir or tag search
E12: Command not allowed from exrc/vimrc in current dir or tag search
E12: Command not allowed from exrc/vimrc in current dir or tag search
Environment
- macOS 10.15.6
- Neovim 0.4.4 (homebrew)
- GoNeovim 0.4.7 (Github release)
- No init.vim
It seems to be about #
sign and txt
ftype, not a goneovim issue.
@psagers @cpkio
Hi,
Thanks for the contribution. This was an issue with Goneovim.
Goneovim needs to detect some Option changes and has its own autocmd to detect them internally.
On the other hand, rpcnotify
running on this autocmd seems to cause E12 in files with ro
or modeline
enabled.
The problem with modeline
causing E12 has been fixed.
https://github.com/akiyosi/goneovim/commit/9949899bdf9a2128edadbbf30d0cc93d3e761c43#commitcomment-42190807
As for the above comment, I was wrong. I will look at ways around this problem.
@psagers
Hi,
The error itself could be suppressed by setting the function call with silent!
.
Please try it.
https://github.com/akiyosi/goneovim/actions/runs/278584984
silent! call rpcnotify(0, "Gui", "gonvim_optionset")
would presumably suppress the errors. Of course it would apply to more than just modelines and would also suppress any legitimate errors in the future. It might be nice to actually understand what gonvim_optionset
is trying to do that Neovim considers to be security-sensitive.
Just a few thoughts. I haven't set up a goneovim build, I just noticed this problem when I was trying it.
Sorry, I had the wrong link. I fixed it to the correct link.
Thanks for the comment. Yes, I think we need to understand the harm of suppressing errors. Currently, I don't have any ideas on how to bypass other implementations, so I'd like to make the feature reduction related to this issue a limitation for a while.
Ah, that makes more sense. I can't seem to run the CI builds. It doesn't appear to be a code signing issue, but I'm not sure what else it would be. In any case, the change looks straightforward enough.
Thanks