From 167de85fe922fbd651f65eb691d7df0b37e1d472 Mon Sep 17 00:00:00 2001 From: HikariKnight Date: Tue, 11 Apr 2023 13:04:02 +0200 Subject: [PATCH] the -k flag can break the elevation prompt when used in go --- pkg/command/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/command/command.go b/pkg/command/command.go index d6a1c55..ef785f2 100644 --- a/pkg/command/command.go +++ b/pkg/command/command.go @@ -39,7 +39,7 @@ func Run(binary string, args ...string) ([]string, error) { // giving us the ability to run sudo commands func Elevate(password string) { // Do a simple sudo command to just authenticate with sudo - cmd := exec.Command("sudo", "-Sk", "--", "echo") + cmd := exec.Command("sudo", "-S", "--", "echo") // Wait for 500ms, if the password is correct, sudo will return immediately cmd.WaitDelay = 1000 * time.Millisecond