From 0af8d93f4d1081b1d2ae38f927aec907b4a544b2 Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Mon, 20 Aug 2018 22:58:54 +0100 Subject: [PATCH] fix: commandShell condition, Join --- lib/http/websockets.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http/websockets.go b/lib/http/websockets.go index b4d4da48..b804e13d 100644 --- a/lib/http/websockets.go +++ b/lib/http/websockets.go @@ -37,7 +37,7 @@ func init() { path, err = exec.LookPath("sh") } - if err != nil { + if err == nil { commandShell = []string{path, "-c"} } } @@ -105,7 +105,7 @@ func command(c *fb.Context, w http.ResponseWriter, r *http.Request) (int, error) buff := new(bytes.Buffer) if len(commandShell) != 0 { - command = append(commandShell, command...) + command = append(commandShell, strings.Join(command, " ")) } // Sets up the command executation.