Documentation ¶
Index ¶
- Variables
- func Verify(clickFile string, allowUnauthenticated bool) (err error)
- type ClickDeb
- func (d *ClickDeb) Build(sourceDir string, dataTarFinishedCallback func(dataName string) error) error
- func (d *ClickDeb) Close() error
- func (d *ClickDeb) ControlMember(controlMember string) (content []byte, err error)
- func (d *ClickDeb) ExtractHashes(dir string) error
- func (d *ClickDeb) MetaMember(metaMember string) (content []byte, err error)
- func (d *ClickDeb) Name() string
- func (d *ClickDeb) NeedsMountUnit() bool
- func (d *ClickDeb) Unpack(src, dst string) error
- func (d *ClickDeb) UnpackAll(targetDir string) error
- func (d *ClickDeb) UnpackWithDropPrivs(instDir, rootdir string) error
- func (d *ClickDeb) Verify(allowUnauthenticated bool) error
- type ErrSignature
- type ErrUnpackFailed
Constants ¶
This section is empty.
Variables ¶
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") )
var VerifyCmd = "debsig-verify"
VerifyCmd is the command to run for Verify
Functions ¶
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 (*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) ControlMember ¶
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 ¶
ExtractHashes reads "hashes.yaml" from the clickdeb and writes it to the given directory.
func (*ClickDeb) MetaMember ¶
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) NeedsMountUnit ¶
NeedsMountUnit returns false because a clickdeb is fully unpacked on disk.
func (*ClickDeb) UnpackAll ¶
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 ¶
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).
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.