Microsoft/vscode

RPM %post scriplet deletes /usr/local/bin/code

Open

#236,132 opened on 2024年12月14日

GitHub で見る
 (1 comment) (1 reaction) (2 assignees)TypeScript (10,221 forks)batch import
bughelp wantedinstall-updatelinuxpackagingrpm

Repository metrics

Stars
 (74,848 stars)
PR merge metrics
 (平均マージ 11h 43m) (30d で 1,000 merged PRs)

説明

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.96.0 (RPM from the Microsoft repo)
  • OS Version: Fedora 41

The %post scriptlet in the RPM spec file deletes /usr/local/bin/code even if it doesn't belong to a previous vscode installation. This is very irritating because it's the easiest way to append arbitrary command line arguments such as --ozone-platform=wayland system-wide. Please either add some validation before deleting it, or just stop deleting it altogether.

https://github.com/microsoft/vscode/blob/1.96.0/resources/linux/rpm/code.spec.template#L48-L51

Steps to Reproduce:

  1. Install a script at /usr/local/bin/code which launches /usr/bin/code with extra arguments
  2. Reinstall the RPM file provided by Microsoft
  3. /usr/local/bin/code is now deleted

コントリビューターガイド