Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeFsOnDiskSecure ¶
func MakeFsOnDiskSecure(root string, allowPrefixes ...string) (filesys.FileSystem, error)
MakeFsOnDiskSecure returns a secure file system which asserts any paths it handles to be inside root. When allowed prefixes are provided, followed absolute links are allowed to traverse into these directories. The root is not allowed to match an allowed prefix, this to ensure an FS instance can not reach into another FS when the allowed prefix configuration is static.
func MakeFsOnDiskSecureBuild ¶
func MakeFsOnDiskSecureBuild(root string, allowPrefixes ...string) (filesys.FileSystem, error)
MakeFsOnDiskSecureBuild calls MakeFsOnDiskSecure, but configures the TmpConfirmedDirPrefix as an allowed prefix. NOTE: When e.g. being able to load remote bases is not a concern, opt to use MakeFsOnDiskSecure instead, unless running into specific traversal issues.
func TmpConfirmedDirPrefix ¶
TmpConfirmedDirPrefix returns the absolute prefix path as constructed by filesys.NewTmpConfirmedDir().
Types ¶
type ConstraintError ¶
ConstraintError records an error and the operation and file that violated it.
func (*ConstraintError) Error ¶
func (e *ConstraintError) Error() string
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error