Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#59506 - [vim] Fix potential problems in archlinux.vim

Attached to Project: Arch Linux
Opened by Lukas (superlukas) - Wednesday, 01 August 2018, 14:29 GMT
Last edited by Levente Polyak (anthraxx) - Monday, 13 August 2018, 15:06 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

There are 2 potential problems in archlinux.vim.

1. nocompatible is set unconditionally. If someone sets nocompatible in /etc/vimrc and does a bunch of configuration below that and then sources archlinux.vim at the bottom, nocompatible is set a second time, which may break/undo some of the configuration done before.

2. suffixes is overwritten rather than added to (suffixes=foo instead of suffixes+=foo). If the vim maintainers decide to add a bunch of new suffixes to the list Arch users won't see them.

I've fixed both of them in good.patch and also cleaned the file up a bit. (I've also removed 'set history=50' because 50 the default value.) The resulting configuration should be identical.

I've also included better.patch which removes a lot of stuff from archlinux.vim that I don't think makes much sense to have in there. The suffix option is way too personal for archlinux.vim (or /etc/vimrc even), XTerm mappings probably are best kept in the ~/.vimrc of a XTerm user and the CVE-workaround should probably be in ~/.vimrc too because no other distro includes it globally so if you log in to a server from your Arch desktop you won't be protected. I've also added 2 options from defaults.vim and sensible.vim, making archlinux.vim basically a tiny subset of both of them.

Feel free to pick the patch you like best. Thanks.
This task depends upon

Closed by  Levente Polyak (anthraxx)
Monday, 13 August 2018, 15:06 GMT
Reason for closing:  Implemented
Additional comments about closing:  8.1.0279-1
Comment by Levente Polyak (anthraxx) - Wednesday, 01 August 2018, 18:55 GMT
CVE fixes won't be dropped and any fix to any tool done on arch won't protect you when logging in into a _foreign_ server and use same tool there, that just doesn't make any sense at all and no-one should ever expect someting being equally fixed/patched on a different foreign server using a different distro.

- checking nocompatible before setting makess totally sense gonna pull that in
- suffixes modification sounds reasonable as well, gonna pull in
- history default value sounds reasonable as well
Comment by Lukas (superlukas) - Wednesday, 01 August 2018, 19:31 GMT
Great! I forgot to mention that I'm not sure the author intended to remove .h and .obj from the suffixes list. You can obviously omit the two lines that remove them if it's all the same to you. I just kept them in (or out rather) for the sake of not making any user-visible changes.
Comment by Levente Polyak (anthraxx) - Wednesday, 01 August 2018, 19:38 GMT
Hm, thats a good question. gonna do some research and think about if it was an accident or had any purpose. thanks for proposing the improvements

Loading...