Documentation
¶
Overview ¶
Package confine maps the file names a user types to paths on disk, keeping them inside one directory when 012 serves sessions over SSH.
A Root's zero value confines nothing: names are used as typed, relative to the working directory, as the local app always has. A Root made with New resolves names inside its directory and rejects absolute paths, names that climb out with "..", hidden files and directories, and symbolic links that lead outside or nowhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutside = errors.New("outside the served directory")
ErrOutside is wrapped by every name a confined Root refuses.
Functions ¶
This section is empty.
Types ¶
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root is a directory names are confined to; the zero value confines nothing.
Click to show internal directories.
Click to hide internal directories.