diff --git a/pkg/proc/debuginfod/debuginfod.go b/pkg/proc/debuginfod/debuginfod.go index e0297b1f61..6eea4479e2 100644 --- a/pkg/proc/debuginfod/debuginfod.go +++ b/pkg/proc/debuginfod/debuginfod.go @@ -1,17 +1,26 @@ package debuginfod import ( + "os" "os/exec" "strings" ) -const debuginfodFind = "debuginfod-find" +const ( + debuginfodFind = "debuginfod-find" + debuginfodMaxtimeEnv = "DEBUGINFOD_MAXTIME" + debuginfodTimeoutEnv = "DEBUGINFOD_TIMEOUT" +) func execFind(args ...string) (string, error) { if _, err := exec.LookPath(debuginfodFind); err != nil { return "", err } cmd := exec.Command(debuginfodFind, args...) + if os.Getenv(debuginfodMaxtimeEnv) == "" || os.Getenv(debuginfodTimeoutEnv) == "" { + cmd.Env = append(os.Environ(), debuginfodMaxtimeEnv+"=1", debuginfodTimeoutEnv+"=1") + } + cmd.Stderr = os.Stderr out, err := cmd.Output() // ignore stderr if err != nil { return "", err