summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-09-15 23:16:13 +0000
committergVisor bot <gvisor-bot@google.com>2021-09-15 23:16:13 +0000
commit9df83e598e95cb0251112d1fca1c4916e74e2f6a (patch)
tree8b7cf134b079ccb71c7578193f356763165771c2 /runsc
parent25072e398de26cc14921a91524bbc586b2dbbda9 (diff)
parenta8ad692fd36cbaf7f5a6b9af39d601053dbee338 (diff)
Merge release-20210906.0-29-ga8ad692fd (automated)
Diffstat (limited to 'runsc')
-rw-r--r--runsc/cmd/run.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/runsc/cmd/run.go b/runsc/cmd/run.go
index 722181aff..da11c9d06 100644
--- a/runsc/cmd/run.go
+++ b/runsc/cmd/run.go
@@ -68,7 +68,14 @@ func (r *Run) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) s
waitStatus := args[1].(*unix.WaitStatus)
if conf.Rootless {
- return Errorf("Rootless mode not supported with %q", r.Name())
+ if conf.Network == config.NetworkSandbox {
+ return Errorf("sandbox network isn't supported with --rootless, use --network=none or --network=host")
+ }
+
+ if err := specutils.MaybeRunAsRoot(); err != nil {
+ return Errorf("Error executing inside namespace: %v", err)
+ }
+ // Execution will continue here if no more capabilities are needed...
}
bundleDir := r.bundleDir