Movatterモバイル変換


[0]ホーム

URL:


chrootarchive

package
v0.1.0Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License:Apache-2.0Imports:16Imported by:134

Details

Repository

github.com/moby/go-archive

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcApplyLayer

func ApplyLayer(deststring, layerio.Reader) (sizeint64, errerror)

ApplyLayer parses a diff in the standard layer format from `layer`,and applies it to the directory `dest`. The stream `layer` can only beuncompressed.Returns the size in bytes of the contents of the layer.

funcApplyUncompressedLayer

func ApplyUncompressedLayer(deststring, layerio.Reader, options *archive.TarOptions) (int64,error)

ApplyUncompressedLayer parses a diff in the standard layer format from`layer`, and applies it to the directory `dest`. The stream `layer`can only be uncompressed.Returns the size in bytes of the contents of the layer.

funcNewArchiver

func NewArchiver(idMappinguser.IdentityMapping) *archive.Archiver

NewArchiver returns a new Archiver which uses chrootarchive.Untar

funcTar

func Tar(srcPathstring, options *archive.TarOptions, rootstring) (io.ReadCloser,error)

Tar tars the requested path while chrooted to the specified root.

funcUntar

func Untar(tarArchiveio.Reader, deststring, options *archive.TarOptions)error

Untar reads a stream of bytes from `archive`, parses it as a tar archive,and unpacks it into the directory at `dest`.The archive may be compressed with one of the following algorithms:identity (uncompressed), gzip, bzip2, xz.

funcUntarUncompressed

func UntarUncompressed(tarArchiveio.Reader, deststring, options *archive.TarOptions)error

UntarUncompressed reads a stream of bytes from `archive`, parses it as a tar archive,and unpacks it into the directory at `dest`.The archive must be an uncompressed stream.

funcUntarWithRoot

func UntarWithRoot(tarArchiveio.Reader, deststring, options *archive.TarOptions, rootstring)error

UntarWithRoot is the same as `Untar`, but allows you to pass in a root directoryThe root directory is the directory that will be chrooted to.`dest` must be a path within `root`, if it is not an error will be returned.

`root` should set to a directory which is not controlled by any potentiallymalicious process.

This should be used to prevent a potential attacker from manipulating `dest`such that it would provide access to files outside of `dest` through thingslike symlinks. Normally `ResolveSymlinksInScope` would handle this, howeversanitizing symlinks in this manner is inherently racey:ref: CVE-2018-15664

Types

This section is empty.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp