From f718022346d9f5da279634aeef430c326587685e Mon Sep 17 00:00:00 2001 From: Herpiko Dwi Aguno Date: Fri, 16 Jul 2021 19:18:53 +0000 Subject: [PATCH] #138 Allow to pass value that has bash escape characters the help of base64 encoding/decoding. --- cmd/cli/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index c90aa43..d54440c 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -1,6 +1,7 @@ package main import ( + b64 "encoding/base64" "encoding/json" "errors" "fmt" @@ -606,7 +607,7 @@ func main() { // Signing a token log.Println("Signing auth token...") cmdStr = "cd " + homeDir + "/.irgsh/tmp/" + tmpID - cmdStr += "/ && echo '" + string(jsonByte) + "' > token && gpg -u " + maintainerSigningKey + " --clearsign --output token.sig --sign token" + cmdStr += "/ && echo '" + b64.StdEncoding.EncodeToString(jsonByte) + "' | base64 -d > token && gpg -u " + maintainerSigningKey + " --clearsign --output token.sig --sign token" fmt.Println(cmdStr) cmd = exec.Command("bash", "-c", cmdStr) // Make it interactive