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

rune/libenclave: Revert the workaround for omitting argv[0]

Signed-off-by: Nshirong <shirong@linux.alibaba.com>
上级 0103f542
......@@ -76,12 +76,11 @@ 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)
argc := len(cmd) + 1
pargs := make([]*C.char, argc)
exe = C.CString(cmd[0])
defer C.free(unsafe.Pointer(exe))
if argc > 1 {
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.
先完成此消息的编辑!
想要评论请 注册