jail

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 7 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) LazyUnbind

func (j *Jail) LazyUnbind() error

LazyUnbind detaches all binded mountpoints

func (*Jail) MkDir

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

MkDir enqueue a mkdir operation at jail building time

func (*Jail) Path

func (j *Jail) Path() string

Path returns the path of the jail

Jump to

Keyboard shortcuts

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