package safepath
import "github.com/dotcloud/docker/internal/safepath"
Index ¶
- type ErrEscapesBase
- type ErrNotAccessible
- func (e *ErrNotAccessible) Error() string
- func (*ErrNotAccessible) NotFound()
- func (e *ErrNotAccessible) Unwrap() error
- type SafePath
Types ¶
type ErrEscapesBase ¶
type ErrEscapesBase struct { Base, Subpath string }
ErrEscapesBase is returned by Join when the resulting concatenation would point outside of the specified base directory.
func (*ErrEscapesBase) Error ¶
func (e *ErrEscapesBase) Error() string
func (*ErrEscapesBase) InvalidParameter ¶
func (*ErrEscapesBase) InvalidParameter()
type ErrNotAccessible ¶
ErrNotAccessible is returned by Join when the resulting path doesn't exist, is not accessible, or any of the path components was replaced with a symlink during the path traversal.
func (*ErrNotAccessible) Error ¶
func (e *ErrNotAccessible) Error() string
func (*ErrNotAccessible) NotFound ¶
func (*ErrNotAccessible) NotFound()
func (*ErrNotAccessible) Unwrap ¶
func (e *ErrNotAccessible) Unwrap() error
type SafePath ¶
type SafePath struct {
// contains filtered or unexported fields
}
func Join ¶
Join locks all individual components of the path which is the concatenation of provided path and its subpath, checks that it doesn't escape the base path and returns the concatenated path.
The path is safe (the path target won't change) until the returned SafePath is Closed. Caller is responsible for calling the Close function which unlocks the path.
func (*SafePath) Close ¶
Close releases the resources used by the path.
func (*SafePath) IsValid ¶
IsValid return true when path can still be used and wasn't cleaned up by Close.
func (*SafePath) Path ¶
Path returns a safe, temporary path that can be used to access the original path.
func (*SafePath) SourcePath ¶
SourcePath returns the source path the safepath points to.
Source Files ¶
common.go errors.go join_windows.go safepath.go
- Version
- v26.0.0-rc1+incompatible
- Published
- Feb 28, 2024
- Platform
- windows/amd64
- Imports
- 11 packages
- Last checked
- 36 minutes ago –
Tools for package owners.