Repository navigation
fix(config): keep config init captures private when overwriting - #127
Merged
Merged
Conversation
config init --file wrote with os.WriteFile, which sets the mode only on create, so an overwritten 0644 file stayed world-readable even when a --from-system capture held the tunnel token. Write a 0600 temp file in the destination directory, sync it and rename it over the destination. A failed write keeps the previous file, and a symlink, special file or file owned by another non-root user is refused.
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. |
entelecheia
added a commit
that referenced
this pull request
Nov 10, 2026
Review follow-up to #127: the stat, write and rename failures in writePrivateConfig named the cause but not what to do next.
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.
Closes #119
rootfiles config init --file FILE --overwriteusedos.WriteFile, which applies the 0600 mode only when it creates the file. An existing 0644 destination stayed 0644, even when a--from-systemcapture held the tunnel token.Policy, now enforced and documented in docs/specs/config.md and docs/commands.md:
--fileis given; only the path is reported.Tests (host-free, temp directories only) cover:
--overwrite, and no content is printed;config initis an operator-side command thatapply,checkand fleet rollouts never run, so servers see no change on upgrade.🤖 Generated with Claude Code