magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

MGS2010: sandbox weakened

A magus started inside a sandboxed run, or a run forwarded to a server, asked for a sandbox mode weaker than the one it runs under. magus refuses it before running anything.

[MGS2010] this magus, started inside a sandboxed run, asked for sandbox mode off, weaker than the best-effort it runs under; a nested or forwarded run may only strengthen the sandbox
[MGS2010] a forwarded run asked for sandbox mode off, weaker than the required it runs under; a nested or forwarded run may only strengthen the sandbox

Why

The modes are ordered off < best-effort < required. A sandboxed run hands every child its mode in MAGUS_SANDBOX, the sandbox.mode setting's own variable and a floor rather than an override, so a nested magus runs under the stronger of that mode and its own workspace's without doing anything. Only a flag could lower it, and a flag written by the code the sandbox confines is exactly what the sandbox must not obey. So a nested magus may pass --sandbox to move up the order and never down.

A forwarded run is the same question asked across the proc socket. A client tells the server the mode it runs under, and the server runs the work under its own workspace's mode. A client flag asking for less than either is refused here. A client whose mode the server's workspace does not meet is not an error: the server declines the run and the client runs it itself, under its own mode.

Resolution

  • Drop the --sandbox flag from the nested or forwarded command, or raise it to the mode named in the message or above.
  • To run a nested magus with less confinement, change the parent: run the outer command under the weaker mode. A child cannot shed its parent's sandbox.
MGS2010sandboxmodenestedserverforwardedstrengthen-only
Last updated (a9ff8609)
Earlier changes on this page (2)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. Workspace in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Ward

A coded diagnostic that inspects a resolved op and nudges or blocks an anti-pattern before it runs. Ward in full.

Sandbox

The restricted filesystem and environment a target runs in, so builds stay reproducible and side-effect-free. Sandbox in full.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate. Run in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.