From a600001ae38c6a0dc569f083dfafb84f3e2ef054 Mon Sep 17 00:00:00 2001 From: hhiew Date: Thu, 24 Nov 2022 22:19:34 +0800 Subject: [PATCH] Update executor.go --- app/executor/executor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/executor/executor.go b/app/executor/executor.go index 1417295..7c84b29 100644 --- a/app/executor/executor.go +++ b/app/executor/executor.go @@ -24,7 +24,9 @@ func Exec(processFile, customLogFile, name, extArgs string, user *user.User, aut uid, _ := strconv.Atoi(user.Uid) gid, _ := strconv.Atoi(user.Gid) + lastSepIdx := strings.LastIndex(processFile, string(os.PathSeparator)) attr := &os.ProcAttr{ + Dir: processFile[0 : lastSepIdx+1], Env: os.Environ(), Files: []*os.File{nil, logOutput, logOutput}, Sys: &syscall.SysProcAttr{