Repository navigation
fix(bubblewrap): start bwrap with an empty environment #1807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -697,7 +697,10 @@ impl BubblewrapScriptRunner { | |
|
|
||
| // 3. Spawn `bwrap`. | ||
| let mut command = Command::new(&bwrap); | ||
| command.args(&args); | ||
| // The confined command can read bwrap's exec-time environment through | ||
| // /proc, so bwrap must not inherit the host's. The command's own | ||
| // environment is passed as --clearenv/--setenv arguments. | ||
| command.env_clear().args(&args); | ||
|
caarlos0 marked this conversation as resolved.
Resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Medium (reliability/correctness) - Apply the same environment rule to availability probes. Attribution:
Fix: keep this
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Declining for this PR. The scenario needs a |
||
| let pty = match stdio { | ||
| StdioMode::Pipes => { | ||
| command | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "$schema": "../../schemas/stable/mxc-config.schema.1.0.0.json", | ||
| "version": "1.0.0", | ||
| "containerId": "CLI-bubblewrap-Env-host_environ", | ||
| "containment": "bubblewrap", | ||
| "process": { | ||
| "commandLine": "for f in /proc/[0-9]*/environ; do p=${f#/proc/}; p=${p%/environ}; if d=$(tr '\\0' '\\n' < \"$f\"); then echo \"READABLE_$p=[yes]\"; echo \"LEAK_$p=[$(printf '%s\\n' \"$d\" | grep -c '^MXC_LEAK_PROBE=')]\"; else echo \"READABLE_$p=[no]\"; fi; done; echo \"CONTROL_SELF=[$(cat /proc/self/environ | tr '\\0' '\\n' | grep -c '^FOO=bar$')]\"; echo \"FOO=[$FOO]\"; echo ENV_PROBE_DONE", | ||
| "cwd": "/tmp", | ||
| "env": ["FOO=bar"], | ||
| "timeout": 20000 | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.