profile: @cwd-rw is @target-rw, because the grant was always {target} - #579
Merged
Merged
Conversation
… (refs #578) The grant is `rw = ["{target}"]` and its sibling is spelled `{target_parent}`. "cwd" named a side effect rather than the grant: `Resolve` sets `Chdir: target` unconditionally and `bwrap.go` emits `--chdir`, so the payload's cwd IS the target at exec — but a payload that `cd /` still has the target writable and its cwd not, and the name is read on the HOST side, where cwd and target differ whenever `snug <dir>` names one. README's own example carried that misreading: "# cwd is read write because of @cwd-rw". Every other user-facing noun is already `target`: {target}, {target_parent}, Policy.Target, SNUG_TARGET, @parent-ro's own comment. After this @target-rw and @parent-ro share it. @cwd-rw joins retiredProfiles beside @null, so the old spelling names the fix instead of reading as a typo — it is in every shipped README example and in whatever `defaults = [...]` anyone wrote. NOT an alias: snug is pre-alpha and two correct spellings forever is worse than one wrong name. Golden diff is the review artifact and it changes exactly two things: the spelling, and SNUG_PROFILES' sort position (@cwd-rw,@home,@sys becomes @home,@sys,@target-rw — Selected is a set, sorted for rendering). 24 golden files, 39 insertions and 39 deletions; no other line moves. No grant, mount, env var or refusal semantics change, so no redteam round is owed. Drive-by, measured while editing it: NameHint's comment said "eight of snug's own profiles are hyphenated". Five are — cwd-rw, parent-ro, git-ro, podman-socket, podman-build. Refs #578 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… the old name
`TestProfileFlagAddsToTheDefaultRatherThanReplacingIt`'s control asserts the
whole default list as one string. The rename moved `@target-rw` past `@home` and
`@sys` alphabetically, so the control failed on order after the spelling was
already right:
fixture: `snug -p @sys` resolved "@home,@sys,@target-rw",
want "@target-rw,@home,@sys"
Selected is a set; the string is sorted for rendering. Measured on this host with
SNUG_REQUIRE_SANDBOX=1, the narrow case passes after the edit.
Refs #578
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
First run was red and one of the two failures was real: fixed in 3a9f7a2. Second failure was |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One rename out of #578's roster review:
@cwd-rw->@target-rw.@sysand@git-roare NOT touched here — see the ticket comment for why@sysstays and why@git-rois a separate ruling.Why the name was wrong
Grant is
rw = ["{target}"]. Sibling isro = ["{target_parent}"].Measured, not assumed:
ResolvesetsChdir: targetunconditionally andbwrap.goemits--chdir, so the payload's cwd IS the target at exec. That is what kept "cwd" from being false INSIDE — and it is still the wrong noun:Chdiris a consequence of the grant, not the grant. A payload thatcd /keeps the target writable and its cwd not.snug <dir>names one. README carried that misreading already:# cwd is read write because of @cwd-rw.target:{target},{target_parent},Policy.Target,SNUG_TARGET.Retirement, not alias
@cwd-rwjoinsretiredProfilesbeside@null, so the old spelling names the fix rather than reading as a typo. Pre-alpha, no alias table: two correct spellings forever is worse than one wrong name.Control pinned in
TestRetiredCwdRwNamesTargetRw: a user's OWNcwd-rwin profiles.d is not preempted by the retirement notice — the@nulltable already learned that one.Golden diff, the review artifact
Exactly two things move:
the spelling, and that sort position (
Selectedis a set, sorted for rendering). 24 golden files, 39 insertions, 39 deletions. Verified no third thing moved:Redteam
None owed. No grant, mount, env var or refusal semantics change; the golden diff above is the evidence.
Drive-by
NameHint's comment claimed "eight of snug's own profiles are hyphenated". Five are: cwd-rw, parent-ro, git-ro, podman-socket, podman-build.make gateexit 0.make integrationrunning on this host; will report.Refs #578
🤖 Generated with Claude Code