Repository navigation
Windows VM: create launcher after start; clear setgid on harden - #12264
Chessing234 wants to merge 9 commits into
Conversation
Automated AI review
Verified: both changes do what the PR describes. No behavior defect was found in the inspected and tested scope. One small cleanup and one optional test case are noted below. Launcher entry now written only after a successful startVerified: The desktop entry content is unchanged. Re-running Install after a failed start reuses the existing mounts and overwrites the compose file, so that path recovers cleanly (source-traced, not executed). Setgid bit cleared when hardening storage directoriesVerified: GNU The root-side chmod-and-check step was emulated as a non-root user with each revision's exact mode string (same Verified: the new Re-added
|
9714bb9 to
b5d6270
Compare
|
dropped the redundant mkdir — prepare_user_mount_sources already creates ~/.windows. |
|
I reproduced the Remove > Windows failure on Omarchy 4.0.4-1 and tested this PR's fix against removal. The menu runs
I added a regression to the existing removal test and opened it against this branch as Chessing234/omarchy#2. It sets # Before the final dc() { :; } and __priv_remove in the removal case:
chmod 2777 "$HOME/Windows"
prepare_caller_mounts # Production assert_mounts_safe calls this as root.
# After __priv_remove and the existing shared-content assertion:
[[ $(stat -c '%a' "$HOME/Windows") == 700 ]] || fail "removal left the shared directory setgid"The PR branch's compose, launcher, and Windows VM tests passed. I put temporary test files in the project directory after the first compose-test run hit this host's |
|
pulled in the setgid removal regression test |
|
thanks for reproducing and for the removal regression test — pulling that in |
Automated AI review
Follow-up to the earlier review, checked on head Verified: no behavior defect was found in the tested scope. The rebase changed nothing in Setgid fix: Dockur supplies the triggerVerified in Dockur source ( New removal regression testVerified: in The test runs as non-root, and
Optional test improvement: assert the setup, gate the helper and reword the final assertion message, so the base reports a named failure (not run as written): chmod 2777 "$HOME/Windows"
[[ $(stat -c '%a' "$HOME/Windows") == 2777 ]] || fail "test setup made the shared directory setgid"
prepare_caller_mounts || fail "prepare_caller_mounts hardens a setgid shared directory"
Shared directory reopens after each start (pre-existing, not introduced by this PR)While Impact: source-traced, not run. This PR neither creates nor widens the exposure, but it no longer ends in a failure. Between a start and the next privileged hardening, the manual's statement that other accounts "cannot browse their contents" does not hold. Suggested change: not required for this PR's fix. This overlaps with open #9783, which changes the same two Review informationTest scope: Source review of the current head, base and earlier reviewed head of AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for folding these together. This pull request makes two independent fixes, and they stand differently. Launcher entry after start (#7943): correct, and nothing else does it. On head The setgid half competes with twelve other open pull requests for the same bug. These all change the same So the proportionate shape for this pull request is the launcher fix alone. Dropping the setgid commit ( This was checked by Claude Opus 5.5, which read both changes against |
|
Following the merge of #12323, The setgid half is now covered; moving creation of the Windows launcher until after successful startup is a separate change. Keep it open for that remaining work, rebased without the duplicate permission fix. Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup. Omabot on behalf of DHH |
|
| chmod 2777 "$HOME/Windows" | ||
| # The privileged production path calls this from assert_mounts_safe; this | ||
| # namespace runs the same helper without root privileges. | ||
| prepare_caller_mounts |
There was a problem hiding this comment.
Removal test bypasses hardening path
The test calls prepare_caller_mounts before __priv_remove, so its permission assertion can pass even if privileged removal stops calling that helper. Exercise hardening through the privileged removal path; otherwise this test will miss a regression in the behavior it is meant to protect.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The setgid hardening it exercised landed on quattro with omacom#12323, whose compose and mount-boundary tests cover it through the root path. This one called prepare_caller_mounts itself before removal, so it could not show that removal hardens the directory, as its comment claimed. What remains is the launcher fix for omacom#7943. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Without -T, a directory at windows-vm.desktop makes mv move the staged entry inside it and succeed, so install reports success with no launcher and no marker the menu sees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
The launcher fix works, and it is now the whole of this pull request. I pushed two small commits to your branch, described below. What was run. The real What I pushed, at
This was reviewed by Claude Opus 5.5 and by Codex Medium as a second opinion. In its first round, Codex found the |
Summary
Same changes as #7985 #9414 , folded so review is one place.
Test plan
Fixes #7943