clickdeb

package
v0.0.0-...-48d87d0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2015 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSnapInvalidContent is returned if a snap package contains
	// invalid content.
	ErrSnapInvalidContent = errors.New("snap contains invalid content")

	// ErrMemberNotFound is returned when a tar member is not found in
	// the archive.
	ErrMemberNotFound = errors.New("member not found")
)
View Source
var VerifyCmd = "debsig-verify"

VerifyCmd is the command to run for Verify

Functions

func Verify

func Verify(clickFile string, allowUnauthenticated bool) (err error)

Verify is a tiny wrapper around debsig-verify

Types

type ClickDeb

type ClickDeb struct {
	// contains filtered or unexported fields
}

ClickDeb provides support for the "click" containers (a special kind of deb package).

func Create

func Create(path string) (*ClickDeb, error)

Create calls os.Create and uses that file for the backing file.

func Open

func Open(path string) (*ClickDeb, error)

Open calls os.Open and uses that file for the backing file.

func (*ClickDeb) Build

func (d *ClickDeb) Build(sourceDir string, dataTarFinishedCallback func(dataName string) error) error

Build takes a build debian directory with DEBIAN/ dir and creates a clickdeb from it.

func (*ClickDeb) Close

func (d *ClickDeb) Close() error

Close closes the backing file

func (*ClickDeb) ControlMember

func (d *ClickDeb) ControlMember(controlMember string) (content []byte, err error)

ControlMember returns the content of the given control member file (e.g. the content of the "manifest" file in the control.tar.gz ar member).

func (*ClickDeb) ExtractHashes

func (d *ClickDeb) ExtractHashes(dir string) error

ExtractHashes reads "hashes.yaml" from the clickdeb and writes it to the given directory.

func (*ClickDeb) MetaMember

func (d *ClickDeb) MetaMember(metaMember string) (content []byte, err error)

MetaMember returns the content of the given meta file (e.g. the content of the "package.yaml" file) from the data.tar.gz ar member's meta/ directory.

func (*ClickDeb) Name

func (d *ClickDeb) Name() string

Name returns the Name of the backing file.

func (*ClickDeb) NeedsMountUnit

func (d *ClickDeb) NeedsMountUnit() bool

NeedsMountUnit returns false because a clickdeb is fully unpacked on disk.

func (*ClickDeb) Unpack

func (d *ClickDeb) Unpack(src, dst string) error

Unpack unpacks the clickdeb

func (*ClickDeb) UnpackAll

func (d *ClickDeb) UnpackAll(targetDir string) error

UnpackAll unpacks the data.tar.{gz,bz2,xz} into the given target directory with click specific verification, i.e. no files will be extracted outside of the targetdir (no ".." inside the data.tar is allowed)

func (*ClickDeb) UnpackWithDropPrivs

func (d *ClickDeb) UnpackWithDropPrivs(instDir, rootdir string) error

UnpackWithDropPrivs will unapck the ClickDeb content into the target dir and drop privs when doing this.

To do this reliably in go we need to exec a helper as we can not just fork() and drop privs in the child (no support for stock fork in go).

func (*ClickDeb) Verify

func (d *ClickDeb) Verify(allowUnauthenticated bool) error

Verify checks that the clickdeb is signed.

type ErrSignature

type ErrSignature struct {
	// contains filtered or unexported fields
}

ErrSignature is returned if a snap failed the signature verification

func (*ErrSignature) Error

func (e *ErrSignature) Error() string

type ErrUnpackFailed

type ErrUnpackFailed struct {
	// contains filtered or unexported fields
}

ErrUnpackFailed is the error type for a snap unpack problem.

func (*ErrUnpackFailed) Error

func (e *ErrUnpackFailed) Error() string

ErrUnpackFailed is returned if unpacking a snap fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL