Documentation ¶
Overview ¶
* Copyright (C) 2019 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. *
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockCompilerVersionInfo ¶
func MockCompilerVersionInfo(versionInfo string) (restore func())
MockCompilerVersionInfo mocks the return value of CompilerVersionInfo.
Types ¶
type BuildTimeRequirementError ¶
BuildTimeRequirementError represents the error case of a feature that cannot be supported because of unfulfilled build time requirements.
func (*BuildTimeRequirementError) Error ¶
func (e *BuildTimeRequirementError) Error() string
func (*BuildTimeRequirementError) RequirementsString ¶
func (e *BuildTimeRequirementError) RequirementsString() string
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func New ¶
New returns a wrapper for the compiler binary. The path to the binary is looked up using the lookupTool helper.
func (*Compiler) Compile ¶
Compile compiles given source profile and saves the result to the out location.
func (*Compiler) VersionInfo ¶
func (c *Compiler) VersionInfo() (VersionInfo, error)
VersionInfo returns the version information of the compiler. The format of version information is: <build-id> <libseccomp-version> <hash> <features>. Where, the hash is calculated over all syscall names supported by the libseccomp library.
type VersionInfo ¶
type VersionInfo string
VersionInfo represents information about the seccomp compilter
func CompilerVersionInfo ¶
func CompilerVersionInfo(lookupTool func(name string) (string, error)) (VersionInfo, error)
CompilerVersionInfo returns the version information of snap-seccomp looked up via lookupTool.
func (VersionInfo) Features ¶
func (vi VersionInfo) Features() (string, error)
Features parses the output of VersionInfo and provides the golang seccomp features
func (VersionInfo) HasFeature ¶
func (vi VersionInfo) HasFeature(feature string) (bool, error)
HasFeature parses the output of VersionInfo and answers whether or not golang-seccomp supports the feature
func (VersionInfo) LibseccompVersion ¶
func (vi VersionInfo) LibseccompVersion() (string, error)
LibseccompVersion parses VersionInfo and provides the libseccomp version
func (VersionInfo) SupportsRobustArgumentFiltering ¶
func (vi VersionInfo) SupportsRobustArgumentFiltering() error
SupportsRobustArgumentFiltering parses the output of VersionInfo and determines if libseccomp and golang-seccomp are new enough to support robust argument filtering