spec

package
v0.0.0-...-66a1b44 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FileModeUnspecified = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

func NewDevice

func NewDevice(target string, type_, major, minor int) Device

func (Device) FileAttr

func (t Device) FileAttr() *FileAttr

func (Device) Major

func (d Device) Major() int

func (Device) Minor

func (d Device) Minor() int

func (Device) Source

func (d Device) Source() string

func (Device) Target

func (t Device) Target() string

func (Device) Type

func (d Device) Type() int

func (Device) Verbose

func (d Device) Verbose() string

type Directory

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

func NewDirectory

func NewDirectory(target string) Directory

func (Directory) FileAttr

func (t Directory) FileAttr() *FileAttr

func (Directory) Source

func (d Directory) Source() string

func (Directory) Target

func (t Directory) Target() string

func (Directory) Verbose

func (d Directory) Verbose() string

type FileAttr

type FileAttr struct {
	UID  int // User id
	GID  int // Group id
	Mode int // File mode
}

FileAttr General file attributes: if these are not specified in the spec, the file permissions of the source will be used for regular files. For directories, the default mode is 755. In all cases, user and group id default to the values of the current user.

type Link struct {
	// contains filtered or unexported fields
}
func NewLink(source, target string, hardLink bool) Link

func (Link) FileAttr

func (t Link) FileAttr() *FileAttr
func (l Link) HardLink() bool

func (Link) Source

func (l Link) Source() string

func (Link) Target

func (t Link) Target() string

func (Link) Verbose

func (l Link) Verbose() string

type RegularFile

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

func NewRegularFile

func NewRegularFile(source, target string) RegularFile

func (RegularFile) FileAttr

func (t RegularFile) FileAttr() *FileAttr

func (RegularFile) Source

func (r RegularFile) Source() string

func (RegularFile) Target

func (t RegularFile) Target() string

func (RegularFile) Verbose

func (r RegularFile) Verbose() string

type Run

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

func NewRun

func NewRun(command string) Run

func (Run) Command

func (r Run) Command() string

func (Run) FileAttr

func (r Run) FileAttr() *FileAttr

func (Run) Source

func (r Run) Source() string

func (Run) Target

func (r Run) Target() string

func (Run) Verbose

func (r Run) Verbose() string

type Statement

type Statement interface {
	// Source outside the chroot, may be empty
	Source() string

	// Target inside the chroot, may be empty
	Target() string

	// Filesystem attributes, may return nil
	FileAttr() *FileAttr

	// Verbose returns a verbose description of the statement suitable for
	// display.
	Verbose() string
}

Statement represents a single filesystem entity or command to be executed inside the chroot.

type Statements

type Statements []Statement

Statements is a sortable slice of Statement elements.

func ExpandLexical

func ExpandLexical(stmts Statements) Statements

ExpandLexical deduplicates and sorts a list of statements while expanding directory paths. Run statements are never deduplicated are kept in order of appearace in the list.

func Parse

func Parse(filename string) (Statements, error)

Parse parses a jailspec file, resolving all include directives. On success, it returns a list of statements and a nil error. Otherwise it returns nil for the list and the encountered error.

func (Statements) Len

func (s Statements) Len() int

func (Statements) Less

func (s Statements) Less(i, j int) bool

func (Statements) Swap

func (s Statements) Swap(i, j int)

Jump to

Keyboard shortcuts

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