Documentation
¶
Index ¶
Constants ¶
const ( //JailFlagCreate use with JailSet to create a jail JailFlagCreate = 0x01 //JailFlagUpdate use with JailSet to update an existing jail JailFlagUpdate = 0x02 //JailFlagAttach use with JailSet to also attach the running process to the jail JailFlagAttach = 0x04 //JailFlagDying allow jails marked as dying JailFlagDying = 0x08 )
Variables ¶
This section is empty.
Functions ¶
func JailAttach ¶
JailAttach attaches the current process to the jail
func JailGetName ¶
JailGetName gets the name of the jail associated with JailID
func JailParseParametersToIovec ¶
JailParseParametersToIovec parses a map[string]interface{} parameter set to []syscall.Iovec for use in Jail syscalls requiring []syscall.Iovec Byte slices & pointers are considered out variables and will be filled with JailGet. for setting handing over variables use strings or ints instead. gojail uses errmsg, and will error out if it's passed as a key No validation is done w.r.t. the type required by the jail parameter
func JailRemove ¶
JailRemove destroys the jail, killing all processes in it
Types ¶
type Jail ¶
type Jail interface { //Name returns the jail name Name() string //ID returns the jail ID ID() JailID //Attach attaches the current running process to the jailq Attach() error //RunIn runs a command inside the jail RunIn() error //Destroy kills all running commands in a jail and removes it from the system Destroy() error //CreateChildJail creates a Jail as a child in the current jail, incrementing max children as needed CreateChildJail(map[string]interface{}) (Jail, error) }
Jail interface to interact with jails
func JailCreate ¶
JailCreate creates a Jail with the given parameters, no validation is done atm accepted types for interface{}: int32/*int32/uint32/*uint32/string/bool/[]byte byte slices MUST be null terminated if the OS expects a string var.
func JailGetByID ¶
JailGetByID queries the OS for Jail with jid jailID
func JailGetByName ¶
JailGetByName queries the OS for Jail with name jailName