You can’t lock down Vim if you give it super user permissions, which you’re doing here. Use sudoedit instead. 

-- 
Christian J. Robinson

On Jun 29, 2024, at 3:24 AM, wangchao732 <vim-dev-git...@256bit.org> wrote:



Steps to reproduce

sudo vim /etc/sudoers
wq!

Expected behaviour

sudo cat /etc/sudoers|grep prometheus
prometheus ALL=(ALL) NOPASSWD: ALL,!//su,!//bash,!/usr/sbin/visudo
[prometheus@cdh6-slave3 ~]$ cat /etc/sudoers
cat: /etc/sudoers: 权限不够

sudo vim /etc/sudoers save: wq!

Version of Vim

7.4

Environment

CentOS Linux release 7.9.2009 (Core)

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/15126@github.com>

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/15126%40github.com.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/2D0FBCD5-A995-4FA8-B0E7-5BD702863F23%40gmail.com.

Raspunde prin e-mail lui