hyprpm: wrap sudo cmd in quotes
Some checks are pending
Build Hyprland / Code Style (Arch) (push) Waiting to run
Build Hyprland / Build Hyprland (Arch) (push) Waiting to run
Build Hyprland / Build Hyprland with Meson (Arch) (push) Waiting to run
Build Hyprland / Build Hyprland without precompiled headers (Arch) (push) Waiting to run
Build Hyprland / Build Hyprland in pure Wayland (Arch) (push) Waiting to run
Nix (CI) / update-inputs (push) Waiting to run
Nix (CI) / build (push) Waiting to run
Security Checks / Flawfinder Checks (push) Waiting to run

ref #10288
This commit is contained in:
Vaxry 2025-05-05 13:09:00 +01:00
parent 1c530cbc66
commit 1f50cdfa8b
No known key found for this signature in database
GPG key ID: 665806380871D640

View file

@ -90,7 +90,7 @@ std::string NSys::runAsSuperuser(const std::string& cmd) {
if (!executableExistsInPath(std::string{BIN})) if (!executableExistsInPath(std::string{BIN}))
continue; continue;
const auto result = execAndGet(std::string{BIN} + " /bin/sh -c " + cmd, true); const auto result = execAndGet(std::string{BIN} + " /bin/sh -c \"" + cmd + "\"", true);
if (!result.has_value() || result->second != 0) if (!result.has_value() || result->second != 0)
Debug::die("Failed to run a command as sudo. This could be due to an invalid password, or a hyprpm bug."); Debug::die("Failed to run a command as sudo. This could be due to an invalid password, or a hyprpm bug.");