mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-12 09:46:25 +08:00
076745a40f
Amend runc features to print seccomp flags. Two set of flags are added: * known flags are those that this version of runc is aware of; * supported flags are those that can be set; normally, this is the same set as known flags, but due to older version of kernel and/or libseccomp, some known flags might be unsupported. This commit also consolidates three different switch statements dealing with flags into one, in func setFlag. A note is added to this function telling what else to look for when adding new flags. Unfortunately, it also adds a list of known flags, that should be kept in sync with the switch statement. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
35 lines
828 B
Go
35 lines
828 B
Go
//go:build !linux || !cgo || !seccomp
|
|
// +build !linux !cgo !seccomp
|
|
|
|
package seccomp
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/opencontainers/runc/libcontainer/configs"
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
|
)
|
|
|
|
var ErrSeccompNotEnabled = errors.New("seccomp: config provided but seccomp not supported")
|
|
|
|
// InitSeccomp does nothing because seccomp is not supported.
|
|
func InitSeccomp(config *configs.Seccomp) (int, error) {
|
|
if config != nil {
|
|
return -1, ErrSeccompNotEnabled
|
|
}
|
|
return -1, nil
|
|
}
|
|
|
|
// FlagSupported tells if a provided seccomp flag is supported.
|
|
func FlagSupported(_ specs.LinuxSeccompFlag) error {
|
|
return ErrSeccompNotEnabled
|
|
}
|
|
|
|
// Version returns major, minor, and micro.
|
|
func Version() (uint, uint, uint) {
|
|
return 0, 0, 0
|
|
}
|
|
|
|
// Enabled is true if seccomp support is compiled in.
|
|
const Enabled = false
|