未验证 提交 91ecc6e8 编写于 作者: H haosanzi 提交者: GitHub

rune: Work around the argv problem between rune and occlum

Signed-off-by: Nshirong <shirong@linux.alibaba.com>
上级 fee7b69b
......@@ -76,12 +76,13 @@ func (pal *enclaveRuntimePalApiV2) exec(cmd []string, envs []string, stdio [3]*o
// Skip cmd[0] as used as the executable.
var exe *C.char
argc := len(cmd) + 1
argc := len(cmd)
pargs := make([]*C.char, argc)
if argc > 1 {
exe = C.CString(cmd[0])
defer C.free(unsafe.Pointer(exe))
cmd = cmd[1:]
for i, arg := range cmd {
logrus.Debugf("arg[%d]: %s", i, arg)
pargs[i] = C.CString(arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册