Repository navigation
Keep ENVIRON empty in sandbox mode - #676
Conversation
In SandboxedAwk and with -S, ENVIRON is no longer populated with the environment of the process: it stays a plain global, empty unless the host passes its own map, which the script then sees unchanged. Remove the unused JRT.assignEnvironmentVariables(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8154536aec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A program or an expression compiled by a plain Awk (or loaded with -S -L) carries the ENVIRON_OFFSET tuple, which the sandboxed compile-time overrides never see. SandboxedAVM now supplies an empty environment through the new AVM.getEnvironment() hook, which covers every path, so the environOffset() overrides are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex please review again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 593ea6ccec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex please review again |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #675.
Change
In sandbox mode (
SandboxedAwkand-S),ENVIRONis no longer populated with the environment of the process.SandboxedAVMoverrides the newAVM.getEnvironment()hook to return an empty map, soENVIRONstays a plain global: empty, or exactly the map the host passes withvariable("ENVIRON", map)orAwkSettings.putVariable(). This is enforced at run time, so it also holds for programs and expressions compiled by a plainAwkand run in the sandbox,-S -Lincluded. No new option. Without the sandbox, nothing changes.strftime()andmktime()in the sandbox therefore use the default time zone unlessENVIRON["TZ"]is set.The unused
JRT.assignEnvironmentVariables()is removed.Tests
AwkTest:eval():ENVIRONis empty (length(ENVIRON)is 0, a real variable of the process reads as"")preassign("ENVIRON", {TZ=UTC})andeval()withAwkSettings.putVariable(): onlyTZis seenAwk, run bySandboxedAwk:ENVIRONis emptyAwk:ENVIRONstill holds the value of the processThe tests pick an existing environment variable at runtime instead of
PATH(namedPathon Windows).Docs
cli.md,java-advanced.md,index.md.vm, andbehavior-changes.md(Unreleased).🤖 Generated with Claude Code