mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
48 lines
905 B
Go
48 lines
905 B
Go
package rununshared
|
|
|
|
import (
|
|
"github.com/criyle/go-sandbox/types/mount"
|
|
"github.com/criyle/go-sandbox/types/rlimit"
|
|
"github.com/criyle/go-sandbox/types/specs"
|
|
)
|
|
|
|
// RunUnshared runs program in unshared namespaces
|
|
type RunUnshared struct {
|
|
// argv and env for the child process
|
|
Args []string
|
|
Env []string
|
|
|
|
// fexecve param
|
|
ExecFile uintptr
|
|
|
|
// workdir is the current dir after unshare mount namespaces
|
|
WorkDir string
|
|
|
|
// file disriptors for new process, from 0 to len - 1
|
|
Files []uintptr
|
|
|
|
// Resource limit set by set rlimit
|
|
RLimits rlimit.RLimits
|
|
|
|
// Resource limit enforced by tracer
|
|
ResLimits specs.ResLimit
|
|
|
|
// Allowed syscall names
|
|
SyscallAllowed []string
|
|
|
|
// New root
|
|
Root string
|
|
|
|
// Mount syscalls
|
|
Mounts []*mount.Mount
|
|
|
|
// hostname & domainname
|
|
HostName, DomainName string
|
|
|
|
// Show Details
|
|
ShowDetails bool
|
|
|
|
// Use by cgroup to add proc
|
|
SyncFunc func(pid int) error
|
|
}
|