jail

package
v1.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jail

type Jail struct {
	// contains filtered or unexported fields
}

Jail is a Chroot jail builder

func Create added in v0.8.1

func Create(path string, perm os.FileMode) *Jail

Create returns a Jail on path, creating the directory if needed. On disposal, the jail will remove the path

func CreateTimestamped added in v0.8.1

func CreateTimestamped(prefix string, perm os.FileMode) *Jail

CreateTimestamped returns a Jail on a path composed by prefix and current timestamp, creating the directory. On disposal, the jail will remove the path

func Into added in v0.8.1

func Into(path string) *Jail

Into returns a Jail on path, assuming it already exists on disk. On disposal, the jail *will not* remove the path

func (*Jail) Bind

func (j *Jail) Bind(dest, src string)

Bind enqueues a bind mount operation at jail building time

func (*Jail) Build

func (j *Jail) Build() error

Build creates the jail, making directories and copying files. If an error setting up is encountered, a best-effort attempt will be made to remove any partial state before returning the error

func (*Jail) CharDev added in v0.8.1

func (j *Jail) CharDev(path string) error

CharDev enqueues an mknod operation for the given character device at jail building time

func (*Jail) Copy

func (j *Jail) Copy(path string) error

Copy enqueues a file copy operation at jail building time

func (*Jail) CopyTo

func (j *Jail) CopyTo(dest, src string) error

CopyTo enqueues a file copy operation at jail building time

func (*Jail) Dispose

func (j *Jail) Dispose() error

Dispose erases everything inside the jail

func (*Jail) ExternalPath

func (j *Jail) ExternalPath(internal string) string

ExternalPath converts a jail internal path to the equivalent jail external path

func (*Jail) MkDir

func (j *Jail) MkDir(path string, perm os.FileMode)

MkDir enqueue a mkdir operation at jail building time

func (*Jail) MkDirAll added in v1.35.0

func (j *Jail) MkDirAll(dir string, perm os.FileMode)

MkDirAll enqueue a mkdir operation at jail building time for all directories in dir to be created one by one

func (*Jail) Path

func (j *Jail) Path() string

Path returns the path of the jail

func (*Jail) Unshare added in v1.24.0

func (j *Jail) Unshare() error

Unshare makes the process to own it's own mount namespace and prevent the changes for mounts to be propagated to other mount namespace. Making all mount changes local to current process

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL