add kdialog for kubuntu key escrow (#24405)

This commit is contained in:
Tim Lee
2024-12-05 08:44:16 -07:00
committed by GitHub
parent 2b071a9e5a
commit e3d9801f6d
13 changed files with 416 additions and 52 deletions
+10 -1
View File
@@ -64,7 +64,16 @@ func runWithOutput(path string, opts eopts) (output []byte, exitCode int, err er
}
}
cmd := exec.Command("sudo", args...)
// Prefix with "timeout" and "sudo" if applicable
var cmdArgs []string
if opts.timeout > 0 {
cmdArgs = append(cmdArgs, "timeout", fmt.Sprintf("%ds", int(opts.timeout.Seconds())))
}
cmdArgs = append(cmdArgs, "sudo")
cmdArgs = append(cmdArgs, args...)
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) // #nosec G204
log.Printf("cmd=%s", cmd.String())
output, err = cmd.Output()