Vencord / Installer

A cross platform gui/cli app for installing Vencord
GNU General Public License v3.0
515 stars 83 forks source link

Only escalate Privileges when necessary #143

Closed RayJW closed 2 months ago

RayJW commented 2 months ago

Currently, the installer (at least on Linux) always escalates privileges. It feels very uncomfortable giving something just downloaded from a domain with curl sudo if there is no clear need. For example, I don't think it's necessary to use sudo when installing Vencord on the Discord user installed Flatpak, since all those folders and files belong to the user.

lewisakura commented 2 months ago

For the majority of the installer's work, it requires root. It was designed to operate on system-installed packages. For user-installed Flatpak, it de-escalates automatically: https://github.com/Vencord/Installer/blob/9f8a013bfccbf6cf80d4b1e7fa4274490e31df7f/patcher.go#L153-L160 You don't need to give it sudo to run the installer on a user-installed Flatpak, just don't use the install script and run the binary directly. We aren't going to update the script though because the majority of users are installing to system-installed Discord and doing so would cause more issues than it's worth handling.

Vendicated commented 2 months ago

the installer rewrite will run as normal user and use pk_exec to elevate.