From 1f50cdfa8be87502c555d29bcfa327fb6bea551d Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 5 May 2025 13:09:00 +0100 Subject: [PATCH] hyprpm: wrap sudo cmd in quotes ref #10288 --- hyprpm/src/helpers/Sys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyprpm/src/helpers/Sys.cpp b/hyprpm/src/helpers/Sys.cpp index 8a6bb687d..70564ab87 100644 --- a/hyprpm/src/helpers/Sys.cpp +++ b/hyprpm/src/helpers/Sys.cpp @@ -90,7 +90,7 @@ std::string NSys::runAsSuperuser(const std::string& cmd) { if (!executableExistsInPath(std::string{BIN})) 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) Debug::die("Failed to run a command as sudo. This could be due to an invalid password, or a hyprpm bug.");