18 lines
249 B
Go
18 lines
249 B
Go
|
|
//go:build linux
|
||
|
|
|
||
|
|
package sandbox
|
||
|
|
|
||
|
|
import (
|
||
|
|
"os/exec"
|
||
|
|
"syscall"
|
||
|
|
)
|
||
|
|
|
||
|
|
func applyCredential(cmd *exec.Cmd, uid, gid int) {
|
||
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||
|
|
Credential: &syscall.Credential{
|
||
|
|
Uid: uint32(uid),
|
||
|
|
Gid: uint32(gid),
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|