From a937ea0b55c47ce77ddbf55348b2c2f1542808b8 Mon Sep 17 00:00:00 2001 From: Jia Zhang Date: Tue, 2 Jun 2020 09:26:45 +0000 Subject: [PATCH] rune/libenclave: Sanity check the returned error of rune exec If the returned error is empty, don't raise an error in any way. Signed-off-by: Jia Zhang --- rune/libenclave/runelet.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rune/libenclave/runelet.go b/rune/libenclave/runelet.go index c0d71b7..d56bfef 100644 --- a/rune/libenclave/runelet.go +++ b/rune/libenclave/runelet.go @@ -302,7 +302,13 @@ func remoteExec(agentPipe *os.File, config *configs.InitEnclaveConfig, notifySig logrus.Debug("awaiting for signal forwarder exiting ...") <-sigForwarderExit logrus.Debug("signal forwarder exited") - return resp.Exec.ExitCode, fmt.Errorf(resp.Exec.Error) + + if resp.Exec.Error == "" { + err = nil + } else { + err = fmt.Errorf(resp.Exec.Error) + } + return resp.Exec.ExitCode, err } func forwardSignalToParent(conn io.Writer, notifySignal chan os.Signal, notifyExit <-chan struct{}) <-chan struct{} { -- GitLab