From 9be647b135b09b8ba5ddecda4495d2fe8923d237 Mon Sep 17 00:00:00 2001 From: Viterkim Date: Fri, 17 Jun 2022 16:22:13 +0200 Subject: [PATCH] Pass in isQueit, it ignored it when getting from env --- cmd/authwrapper/main.go | 2 +- cmd/authwrapper/utils.go | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/authwrapper/main.go b/cmd/authwrapper/main.go index 7ec3fbf..97eea8b 100644 --- a/cmd/authwrapper/main.go +++ b/cmd/authwrapper/main.go @@ -67,7 +67,7 @@ func main() { } } - exitCode, err := runCommandWithSSHAgent(agent, config.Command, config.Args) + exitCode, err := runCommandWithSSHAgent(agent, config.Command, config.Args, config.AuthWrapperQuiet) if err != nil { log.Fatalf("runCommandWithSSHAgent: %v", err) } diff --git a/cmd/authwrapper/utils.go b/cmd/authwrapper/utils.go index 0693a8b..166d786 100644 --- a/cmd/authwrapper/utils.go +++ b/cmd/authwrapper/utils.go @@ -24,18 +24,14 @@ import ( var httpClient = &http.Client{Timeout: 10 * time.Second} -func runCommandWithSSHAgent(agent agent.ExtendedAgent, command string, args []string) (exitCode int, err error) { +func runCommandWithSSHAgent(agent agent.ExtendedAgent, command string, args []string, isQuiet bool) (exitCode int, err error) { sshAuthSock, err := sshagent.StartSSHAgentServer(agent) if err != nil { return 255, fmt.Errorf("Failed to start ssh agent server: %v", err) } // Hide this behind quiet until the Go standard library has support for the new "agentc" extension in Open-SSH - config, err := parseEnvironment() - if err != nil { - log.Fatalf(": %v", err) - } - if config.AuthWrapperQuiet == false { + if isQuiet == false { os.Setenv("SSH_AUTH_SOCK", sshAuthSock) }