2022-08-06 00:27:34 +08:00
|
|
|
//go:build (!linux && !freebsd) || !seccomp
|
2018-05-12 01:08:18 +08:00
|
|
|
|
|
|
|
package chroot
|
|
|
|
|
|
|
|
import (
|
2022-07-06 17:14:06 +08:00
|
|
|
"errors"
|
|
|
|
|
2018-05-12 01:08:18 +08:00
|
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
|
|
|
)
|
|
|
|
|
2023-10-05 05:07:30 +08:00
|
|
|
const seccompAvailable = false
|
|
|
|
|
2018-05-12 01:08:18 +08:00
|
|
|
func setSeccomp(spec *specs.Spec) error {
|
|
|
|
if spec.Linux.Seccomp != nil {
|
|
|
|
return errors.New("configured a seccomp filter without seccomp support?")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
2021-10-27 05:16:44 +08:00
|
|
|
|
|
|
|
func setupSeccomp(spec *specs.Spec, seccompProfilePath string) error {
|
|
|
|
if spec.Linux != nil {
|
|
|
|
// runtime-tools may have supplied us with a default filter
|
|
|
|
spec.Linux.Seccomp = nil
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|