aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/options.go
diff options
context:
space:
mode:
authorGreg Steuck <gnezdo@google.com>2018-12-11 14:30:49 -0800
committerDmitry Vyukov <dvyukov@google.com>2018-12-13 09:44:24 +0100
commitf3d9d5948cad441ab08e763c8ed86efe79f4198b (patch)
tree6e1c38fcb434a2aa74928a1a9871a77e406c273f /pkg/csource/options.go
parentec0147d47fb25d0efdc677000312db1919ea0086 (diff)
pkg/csource: support tun and setuid repros on {free,open}bsd
* expose procid on BSD for tun, always declare loop() * deal with terrible bsd includes * replicate loop() declaration
Diffstat (limited to 'pkg/csource/options.go')
-rw-r--r--pkg/csource/options.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/csource/options.go b/pkg/csource/options.go
index 6dc3a249e..4a0cc9fbc 100644
--- a/pkg/csource/options.go
+++ b/pkg/csource/options.go
@@ -95,7 +95,7 @@ func (opts Options) checkLinuxOnly(OS string) error {
if OS == linux {
return nil
}
- if opts.EnableTun {
+ if opts.EnableTun && !(OS == "openbsd" || OS == "freebsd") {
return fmt.Errorf("EnableTun is not supported on %v", OS)
}
if opts.EnableCgroups {
@@ -107,7 +107,9 @@ func (opts Options) checkLinuxOnly(OS string) error {
if opts.ResetNet {
return fmt.Errorf("ResetNet is not supported on %v", OS)
}
- if opts.Sandbox == sandboxNamespace || opts.Sandbox == sandboxSetuid || opts.Sandbox == sandboxAndroidUntrustedApp {
+ if opts.Sandbox == sandboxNamespace ||
+ (opts.Sandbox == sandboxSetuid && !(OS == "openbsd" || OS == "freebsd")) ||
+ opts.Sandbox == sandboxAndroidUntrustedApp {
return fmt.Errorf("Sandbox=%v is not supported on %v", opts.Sandbox, OS)
}
if opts.Fault {