From dd6ec82cba639585d72dd731afa3d532787c6ae4 Mon Sep 17 00:00:00 2001 From: lordwelch Date: Fri, 7 Aug 2020 14:11:33 -0700 Subject: [PATCH] Detach the command to open the url so the http server can start --- provider/provider.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/provider/provider.go b/provider/provider.go index a25dc5b..1bfde65 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -203,7 +203,7 @@ func (p ProviderConfig) Authenticate(t *OAuth2Token) error { }) // Filter the commands, and replace "{}" with our callback url - c := p.AgentCommand[:0] + c := make([]string, 0, len(p.AgentCommand)) replacedURL := false for _, arg := range p.AgentCommand { if arg == "{}" { @@ -219,7 +219,8 @@ func (p ProviderConfig) Authenticate(t *OAuth2Token) error { //TODO Drop privileges cmd := exec.Command(c[0], c[1:]...) - cmd.Run() + cmd.Start() + cmd.Process.Release() server := &http.Server{} go func() {