From f3d9d5948cad441ab08e763c8ed86efe79f4198b Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Tue, 11 Dec 2018 14:30:49 -0800 Subject: 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 --- pkg/csource/options.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkg/csource/options.go') 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 { -- cgit mrf-deployment