Skip to content

fix(probe): run version probe under owner-only umask - #3

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/probe-umask-owner-only
Aug 4, 2026
Merged

fix(probe): run version probe under owner-only umask#3
rldyourmnd merged 1 commit into
mainfrom
fix/probe-umask-owner-only

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Problem

install-cli failed under an ambient umask of 0002 with:

cleanup object directory must have mode 0700: <target>/.nddev-opencode-software-stage.<pid>.<ns>/probe-home/.cache

Root cause

run_version_probe runs the OpenCode binary under an isolated HOME (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_record requires exactly mode 0700) rejects them.

Fix

Force an owner-only umask (0o077) via preexec_fn on 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 PASS

Real lifecycle on a host with umask 0002:

install-cli --target <isolated-target> --json
# { "ok": true, "operation": "install-cli" }

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.
@rldyourmnd
rldyourmnd merged commit 036f91e into main Aug 4, 2026
10 checks passed
@rldyourmnd
rldyourmnd deleted the fix/probe-umask-owner-only branch August 4, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant