fix(probe): run version probe under owner-only umask - #3
Merged
Conversation
The version probe runs the OpenCode binary under an isolated HOME it may write to (e.g. ~/.cache). Under an ambient umask such as 0002, the binary creates those directories group-writable, and the subsequent cleanup- object mode journaling rejects them with: cleanup object directory must have mode 0700: .../probe-home/.cache Force an owner-only umask (0o077) via preexec_fn so anything the probe creates is already mode 0700/0600 and survives the cleanup-object mode journaling, regardless of the caller's ambient umask. The journal integrity check is unchanged.
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.
Problem
install-clifailed under an ambient umask of 0002 with:Root cause
run_version_proberuns the OpenCode binary under an isolatedHOME(probe-home) that the binary may write to (e.g.~/.cache). Under umask 0002 those directories are created group-writable, and the subsequent cleanup-object mode journaling (cleanup_object_recordrequires exactly mode 0700) rejects them.Fix
Force an owner-only umask (
0o077) viapreexec_fnon the probe subprocess so anything it creates is already mode 0700/0600 and survives the cleanup-object journaling. The journal integrity check is unchanged.Verification
python3 scripts/run_harnesses.py --module nddev-opencode-app --lane fast # 87 tests OK (2 skipped), validate_fast.sh PASSReal lifecycle on a host with umask 0002: