[vim/vim] Forced write to read-only file silently changes file ownership — warning message should be more explicit (Issue #19442)

3 views
Skip to first unread message

progsourcemy

unread,
Feb 17, 2026, 9:19:11 PM (7 days ago) Feb 17
to vim/vim, Subscribed
progsourcemy created an issue (vim/vim#19442)

When a user forces vim to write a read-only file (:w!), vim may silently replace the original file with a new one owned by the current user. This behavior can have serious security implications that are not communicated in the warning message shown to the user.

E45: 'readonly' option is set (add ! to override)

ESC ESC

:w!

ESC ESC

:w!

Do you really want to write to it (y/n)?
y


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/19442@github.com>

Christian Brabandt

unread,
Feb 18, 2026, 2:08:15 AM (7 days ago) Feb 18
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19442)

I suppose this depends on the 'backupcopy' option and I guess this is just a consequence how Unix permissions work in general. There is already a warning so you should be careful. I don't think there is anything to be done here


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/19442/3919097948@github.com>

Christian Brabandt

unread,
4:55 PM (6 hours ago) 4:55 PM
to vim/vim, Subscribed

Closed #19442 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19442/issue_event/23048944819@github.com>

Reply all
Reply to author
Forward
0 new messages