Documentation ¶
Index ¶
Constants ¶
const FileModeUnspecified = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
type FileAttr ¶
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 RegularFile ¶
type RegularFile struct {
// contains filtered or unexported fields
}
func NewRegularFile ¶
func NewRegularFile(source, target string) RegularFile
func (RegularFile) Source ¶
func (r RegularFile) Source() string
func (RegularFile) Verbose ¶
func (r RegularFile) 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)