2016-03-24 07:13:30 +00:00
|
|
|
package executor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (e *ExecScriptCheck) setChroot(cmd *exec.Cmd) {
|
|
|
|
if e.FSIsolation {
|
|
|
|
if cmd.SysProcAttr == nil {
|
|
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
|
|
|
}
|
2016-03-24 23:33:04 +00:00
|
|
|
cmd.SysProcAttr.Chroot = e.taskDir
|
2016-03-24 07:13:30 +00:00
|
|
|
}
|
|
|
|
cmd.Dir = "/"
|
|
|
|
}
|